Setup counter for Productivity Analytics
This change sets up a usage counter for productivity analytics feature.
This commit is contained in:
parent
c2e4680262
commit
ff7c992ebd
|
|
@ -142,6 +142,7 @@ module Gitlab
|
|||
Gitlab::UsageDataCounters::SnippetCounter,
|
||||
Gitlab::UsageDataCounters::SearchCounter,
|
||||
Gitlab::UsageDataCounters::CycleAnalyticsCounter,
|
||||
Gitlab::UsageDataCounters::ProductivityAnalyticsCounter,
|
||||
Gitlab::UsageDataCounters::SourceCodeCounter,
|
||||
Gitlab::UsageDataCounters::MergeRequestCounter
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab::UsageDataCounters
|
||||
class ProductivityAnalyticsCounter < BaseCounter
|
||||
KNOWN_EVENTS = %w[views].freeze
|
||||
PREFIX = 'productivity_analytics'
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
# 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue