diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /lib/product_analytics | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'lib/product_analytics')
-rw-r--r-- | lib/product_analytics/tracker.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/product_analytics/tracker.rb b/lib/product_analytics/tracker.rb index 2dc5e1f53ce..d4a88b879f0 100644 --- a/lib/product_analytics/tracker.rb +++ b/lib/product_analytics/tracker.rb @@ -7,36 +7,5 @@ module ProductAnalytics # The collector URL minus protocol and /i COLLECTOR_URL = Gitlab.config.gitlab.url.sub(/\Ahttps?\:\/\//, '') + '/-/collector' - - class << self - include Gitlab::Utils::StrongMemoize - - 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_f * 1000).to_i) - end - - private - - def enabled? - Gitlab::CurrentSettings.usage_ping_enabled? - end - - def project_id - Gitlab::CurrentSettings.self_monitoring_project_id - end - - def snowplow - strong_memoize(:snowplow) do - SnowplowTracker::Tracker.new( - SnowplowTracker::AsyncEmitter.new(COLLECTOR_URL, protocol: Gitlab.config.gitlab.protocol), - SnowplowTracker::Subject.new, - Gitlab::Tracking::SNOWPLOW_NAMESPACE, - project_id.to_s - ) - end - end - end end end |