diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-11-06 12:43:37 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-11-06 12:43:37 +0200 |
commit | a06a423359cf47fa92776814e47389e38ef78208 (patch) | |
tree | cd570df49348212a56d7c356dd7ffe8e1f85d783 /lib | |
parent | 522d70c0c75de4ffa165487899530e4ba3158cee (diff) | |
download | gitlab-ci-a06a423359cf47fa92776814e47389e38ef78208.tar.gz |
Charts: show commit duration instead of build
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/charts.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/charts.rb b/lib/charts.rb index c84987c..851518f 100644 --- a/lib/charts.rb +++ b/lib/charts.rb @@ -55,10 +55,10 @@ module Charts class BuildTime < Chart def collect - builds = project.builds.where('builds.finished_at is NOT NULL AND builds.started_at is NOT NULL').last(30) - builds.each do |build| - @labels << build.short_sha - @build_times << (build.duration / 60) + commits = project.commits.joins(:builds).where('builds.finished_at is NOT NULL AND builds.started_at is NOT NULL').last(30) + commits.each do |commit| + @labels << commit.short_sha + @build_times << (commit.duration / 60) end end end |