Class: Gitlab::Ci::Charts::PipelineTime

Inherits:
Chart
  • Object
show all
Defined in:
lib/gitlab/ci/charts.rb

Instance Attribute Summary

Attributes inherited from Chart

#from, #labels, #pipeline_times, #project, #success, #to, #total

Instance Method Summary collapse

Methods inherited from Chart

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Ci::Charts::Chart

Instance Method Details

#collectObject


92
93
94
95
96
97
98
99
100
# File 'lib/gitlab/ci/charts.rb', line 92

def collect
  commits = project.all_pipelines.last(30)

  commits.each do |commit|
    @labels << commit.short_sha
    duration = commit.duration || 0
    @pipeline_times << (duration / 60)
  end
end