Commit 872d67b9 authored by alinamihaila's avatar alinamihaila

Add metric operation to generic and redis_hll metrics

parent 00622aef
1# frozen_string_literal: true
# frozen_string_literal: true
module Gitlab
module Usage
......@@ -55,10 +55,6 @@ module Gitlab
)
end
def relation
self.class.metric_relation.call.where(time_constraints)
end
private
def relation
......
......@@ -13,6 +13,9 @@ module Gitlab
# end
# end
class << self
attr_reader :metric_operation
@metric_operation = :alt
def value(&block)
@metric_value = block
end
......@@ -28,9 +31,7 @@ module Gitlab
def suggested_name
Gitlab::Usage::Metrics::NameSuggestion.for(
:alt,
relation: nil,
column: nil
self.class.metric_operation
)
end
end
......
......@@ -12,6 +12,11 @@ module Gitlab
# events:
# - g_analytics_valuestream
# end
class << self
attr_reader :metric_operation
@metric_operation = :redis
end
def initialize(time_frame:, options: {})
super
......@@ -32,9 +37,7 @@ module Gitlab
def suggested_name
Gitlab::Usage::Metrics::NameSuggestion.for(
:redis,
relation: nil,
column: nil
self.class.metric_operation
)
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