Commit 44dd3d2d authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'track-usage-data-for-analytics-features' into 'master'

Setup counter for Productivity Analytics

See merge request gitlab-org/gitlab-ce!32915
parents c2e46802 ff7c992e
...@@ -142,6 +142,7 @@ module Gitlab ...@@ -142,6 +142,7 @@ module Gitlab
Gitlab::UsageDataCounters::SnippetCounter, Gitlab::UsageDataCounters::SnippetCounter,
Gitlab::UsageDataCounters::SearchCounter, Gitlab::UsageDataCounters::SearchCounter,
Gitlab::UsageDataCounters::CycleAnalyticsCounter, Gitlab::UsageDataCounters::CycleAnalyticsCounter,
Gitlab::UsageDataCounters::ProductivityAnalyticsCounter,
Gitlab::UsageDataCounters::SourceCodeCounter, Gitlab::UsageDataCounters::SourceCodeCounter,
Gitlab::UsageDataCounters::MergeRequestCounter Gitlab::UsageDataCounters::MergeRequestCounter
] ]
......
# frozen_string_literal: true
module Gitlab::UsageDataCounters
class ProductivityAnalyticsCounter < BaseCounter
KNOWN_EVENTS = %w[views].freeze
PREFIX = 'productivity_analytics'
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::UsageDataCounters::ProductivityAnalyticsCounter do
it_behaves_like 'a redis usage counter', 'ProductivityAnalytics', :views
it_behaves_like 'a redis usage counter with totals', :productivity_analytics, views: 3
end
...@@ -62,6 +62,7 @@ describe Gitlab::UsageData do ...@@ -62,6 +62,7 @@ describe Gitlab::UsageData do
influxdb_metrics_enabled influxdb_metrics_enabled
prometheus_metrics_enabled prometheus_metrics_enabled
cycle_analytics_views cycle_analytics_views
productivity_analytics_views
)) ))
expect(subject).to include( expect(subject).to include(
...@@ -79,6 +80,7 @@ describe Gitlab::UsageData do ...@@ -79,6 +80,7 @@ describe Gitlab::UsageData do
web_ide_merge_requests: a_kind_of(Integer), web_ide_merge_requests: a_kind_of(Integer),
navbar_searches: a_kind_of(Integer), navbar_searches: a_kind_of(Integer),
cycle_analytics_views: a_kind_of(Integer), cycle_analytics_views: a_kind_of(Integer),
productivity_analytics_views: a_kind_of(Integer),
source_code_pushes: a_kind_of(Integer) source_code_pushes: a_kind_of(Integer)
) )
end end
......
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