diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-25 21:12:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-25 21:12:16 +0300 |
commit | 942229d2b424e0c505aa676cbd8e173e4c99d83a (patch) | |
tree | 027906274143f48ba7aa67829a4ca898b23bc94d /lib/gitlab/utils | |
parent | 82c63f420c7fc2229a44aa336d656a9712884f83 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils')
-rw-r--r-- | lib/gitlab/utils/usage_data.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/utils/usage_data.rb b/lib/gitlab/utils/usage_data.rb index d46210f6efe..0c4d767f126 100644 --- a/lib/gitlab/utils/usage_data.rb +++ b/lib/gitlab/utils/usage_data.rb @@ -43,8 +43,13 @@ module Gitlab HISTOGRAM_FALLBACK = { '-1' => -1 }.freeze DISTRIBUTED_HLL_FALLBACK = -2 MAX_BUCKET_SIZE = 100 + INSTRUMENTATION_CLASS_FALLBACK = -100 def add_metric(metric, time_frame: 'none') + # Results of this method should be overwritten by instrumentation class values + # -100 indicates the metric was not properly merged. + return INSTRUMENTATION_CLASS_FALLBACK if Feature.enabled?(:usage_data_instrumentation) + metric_class = "Gitlab::Usage::Metrics::Instrumentations::#{metric}".constantize metric_class.new(time_frame: time_frame).value |