Commit 9c8c9690 authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '37956-tracking-rb-sends-wrong-creation-timestamp-to-snowplow-it-should-send-in-milliseconds' into 'master'

Tracking.rb should send creation timestamp  in milliseconds

See merge request gitlab-org/gitlab!21074
parents 93ab97ca 523428bf
......@@ -29,14 +29,14 @@ module Gitlab
def event(category, action, label: nil, property: nil, value: nil, context: nil)
return unless enabled?
snowplow.track_struct_event(category, action, label, property, value, context, Time.now.to_i)
snowplow.track_struct_event(category, action, label, property, value, context, (Time.now.to_f * 1000).to_i)
end
def self_describing_event(schema_url, event_data_json, context: nil)
return unless enabled?
event_json = SnowplowTracker::SelfDescribingJson.new(schema_url, event_data_json)
snowplow.track_self_describing_event(event_json, context, Time.now.to_i)
snowplow.track_self_describing_event(event_json, context, (Time.now.to_f * 1000).to_i)
end
def snowplow_options(group)
......
......@@ -97,7 +97,7 @@ describe Gitlab::Tracking do
'_property_',
'_value_',
nil,
timestamp.to_i
(timestamp.to_f * 1000).to_i
)
track_event
......@@ -130,7 +130,7 @@ describe Gitlab::Tracking do
expect(tracker).to receive(:track_self_describing_event).with(
'_event_json_',
nil,
timestamp.to_i
(timestamp.to_f * 1000).to_i
)
track_event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment