CircleCI doesn't give super useful stats about build times over time.
I wanted to see if our builds were getting slower (or faster), which jobs were taking a lot of time, etc.
So here's a CLI that calls the circle API, builds some pretty graphs, and wraps them in an html page.
git clone https://github.com/tducasse/circleci-stats.git
cd circleci-stats
# I tested it with Python 3.8
pip install -r requirements.txt
This script uses python-dotenv, so everything is handled with env variables, and you can choose whether you want to store them in your environment directly or in a .env
file.
# .env
# get an API token from circle
TOKEN=your_circle_token
# just so that we don't fetch every job on every branch ๐ฌ
BRANCH=develop
# just get jobs for this workflow
WORKFLOW=deploy-develop
# project slug in circleci
PROJECT=gh/username/repo_name
# number of builds to fetch from the API
LIMIT=50
# use this if you use WSL on windows
WSL_ROOT=$wsl/Ubuntu
python main.py