debian-mirror-gitlab/lib/gitlab/usage/metrics/instrumentations/generic_metric.rb
2021-06-08 01:23:25 +05:30

32 lines
658 B
Ruby

# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class GenericMetric < BaseMetric
# Usage example
#
# class UuidMetric < GenericMetric
# value do
# Gitlab::CurrentSettings.uuid
# end
# end
class << self
def value(&block)
@metric_value = block
end
attr_reader :metric_value
end
def value
alt_usage_data do
self.class.metric_value.call
end
end
end
end
end
end
end