Commit ff7c992e authored by Adam Hegyi's avatar Adam Hegyi Committed by Peter Leitzen

Setup counter for Productivity Analytics

This change sets up a usage counter for productivity analytics feature.
parent c2e46802
......@@ -142,6 +142,7 @@ module Gitlab
Gitlab::UsageDataCounters::SnippetCounter,
Gitlab::UsageDataCounters::SearchCounter,
Gitlab::UsageDataCounters::CycleAnalyticsCounter,
Gitlab::UsageDataCounters::ProductivityAnalyticsCounter,
Gitlab::UsageDataCounters::SourceCodeCounter,
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
influxdb_metrics_enabled
prometheus_metrics_enabled
cycle_analytics_views
productivity_analytics_views
))
expect(subject).to include(
......@@ -79,6 +80,7 @@ describe Gitlab::UsageData do
web_ide_merge_requests: a_kind_of(Integer),
navbar_searches: 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)
)
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