It downloads artifacts from your Circle CI and persists into a database. Allowing you to study performance per build.
- Create or get your key on Circle CI api.
- Set your environment variable on a
.env
file in the main directory of these project
export CI_TOKEN=myAwesomeToken
export CI_REPOSITORY="rdstation"
export CI_USERNAME="ResultadosDigitais"
- Setup your database
create database circleci;
\c circleci
create table performances (build integer, file varchar, time float, container integer);
create table builds (build_num integer, author_name varchar, branch varchar,
build_time_millis bigint, queued_at timestamp, start_time timestamp, subject text);
alter table builds add unique (build_num);
- Choose recent builds to analyse
Supose you get a list of your recent successful builds:
builds = CircleCi::Project.recent_builds $username, $repo
build_nums = builds
.body
.select{|e|e["status"] =~ /fixed|success/ && e["branch"] !="master"}
.map{|e|e["build_num"]}
So, fetch and persist data:
build_nums.each{|build_num| fetch build_num }
- Now explore!
Performance.group(:build).average(:time)
Performance.group(:build, :container).average(:time)
stdev_per_file