Create (or repurpose) a script to gather CI pipeline usage
Issue Background
We use AWS to host our GitLab CI/CD build runners, shared between all CIP projects. In AWS we can see how many hours these runners are used for, but we don't have a breakdown of how much each CIP project are using the runners. We need a way to break down usage more so we can analyse usage.
Issue description
Create a script (or repurpose an existing script) that will use the GitLab API to gather data on a per-project basis. The following metrics should be gathered for a given time period:
- Number of pipelines run
- Number of jobs run, per gitlab runner type (we use the "large" and "small" tags to denote on which runner a job should run)
- Number of hours/minutes spent in total, per runner type
Acceptance criteria
A script (or multiple scripts) is created that supports the following:
-
Input: date range, or previous x days, or last month, or for each x previous months etc. -
Input: project name -
Output: number of pipelines run -
Output: number of jobs run, per runner type (large or small or other) -
Output: time spent in total per runner type -
Extra: a wrapper script that will call the main script for each CIP project