production_stage.rb 666 字节
Newer Older
1 2 3
module Gitlab
  module CycleAnalytics
    class ProductionStage < BaseStage
4 5
      include ProductionHelper

6 7 8
      def start_time_attrs
        @start_time_attrs ||= issue_table[:created_at]
      end
J
James Lopez 已提交
9

10 11
      def end_time_attrs
        @end_time_attrs ||= mr_metrics_table[:first_deployed_to_production_at]
12 13
      end

14
      def name
J
James Lopez 已提交
15 16 17 18 19
        :production
      end

      def description
        "From issue creation until deploy to production"
20
      end
21 22 23 24 25

      def query
        # Limit to merge requests that have been deployed to production after `@from`
        query.where(mr_metrics_table[:first_deployed_to_production_at].gteq(@from))
      end
26 27 28
    end
  end
end