2016-11-16 06:01:10 -05:00
|
|
|
module Gitlab
|
|
|
|
module CycleAnalytics
|
2016-11-17 07:22:27 -05:00
|
|
|
class CodeEvent < BaseEvent
|
2016-11-18 06:05:29 -05:00
|
|
|
include MergeRequestAllowed
|
|
|
|
|
2016-11-17 12:00:37 -05:00
|
|
|
def initialize(*args)
|
|
|
|
@stage = :code
|
|
|
|
@start_time_attrs = issue_metrics_table[:first_mentioned_in_commit_at]
|
|
|
|
@end_time_attrs = mr_table[:created_at]
|
|
|
|
@projections = [mr_table[:title],
|
|
|
|
mr_table[:iid],
|
|
|
|
mr_table[:id],
|
|
|
|
mr_table[:created_at],
|
|
|
|
mr_table[:state],
|
|
|
|
mr_table[:author_id]]
|
|
|
|
@order = mr_table[:created_at]
|
2016-11-16 06:01:10 -05:00
|
|
|
|
2016-11-17 12:00:37 -05:00
|
|
|
super(*args)
|
|
|
|
end
|
2016-11-16 06:01:10 -05:00
|
|
|
|
2016-11-17 12:00:37 -05:00
|
|
|
private
|
2016-11-17 07:22:27 -05:00
|
|
|
|
2016-11-17 12:00:37 -05:00
|
|
|
def serialize(event)
|
|
|
|
AnalyticsMergeRequestSerializer.new(project: @project).represent(event).as_json
|
|
|
|
end
|
2016-11-16 06:01:10 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|