Commit 485c457a authored by Kerri Miller's avatar Kerri Miller

Merge branch...

Merge branch '330316-improve-repeated-module-namespace-in-usage-data-metrics-instrumentation' into 'master'

Improve repeated module namespace in usage data metrics instrumentation

See merge request gitlab-org/gitlab!61835
parents 5a0c3d4b e05f6f6e
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 28d time_frame: 28d
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric' instrumentation_class: CountUsersCreatingIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 28d time_frame: 28d
data_source: redis_hll data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric' instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: 7d time_frame: 7d
data_source: redis_hll data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric' instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountIssuesMetric' instrumentation_class: CountIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric' instrumentation_class: CountUsersCreatingIssuesMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -9,7 +9,7 @@ value_type: number ...@@ -9,7 +9,7 @@ value_type: number
status: data_available status: data_available
time_frame: all time_frame: all
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountBoardsMetric' instrumentation_class: CountBoardsMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -11,7 +11,7 @@ milestone: "9.1" ...@@ -11,7 +11,7 @@ milestone: "9.1"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521 introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521
time_frame: none time_frame: none
data_source: database data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::UuidMetric' instrumentation_class: UuidMetric
distribution: distribution:
- ee - ee
- ce - ce
......
...@@ -9,7 +9,7 @@ value_type: string ...@@ -9,7 +9,7 @@ value_type: string
status: data_available status: data_available
time_frame: none time_frame: none
data_source: system data_source: system
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::HostnameMetric' instrumentation_class: HostnameMetric
distribution: distribution:
- ce - ce
- ee - ee
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
}, },
"instrumentation_class": { "instrumentation_class": {
"type": "string", "type": "string",
"pattern": "^(Gitlab::Usage::Metrics::Instrumentations::)(([A-Z][a-z]+)+::)*(([A-Z][a-z]+)+)$" "pattern": "^(([A-Z][a-z]+)+::)*(([A-Z][a-z]+)+)$"
}, },
"distribution": { "distribution": {
"type": "array", "type": "array",
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
instrumentation_class = definition.attributes[:instrumentation_class] instrumentation_class = definition.attributes[:instrumentation_class]
if instrumentation_class.present? if instrumentation_class.present?
metric_value = instrumentation_class.constantize.new(time_frame: definition.attributes[:time_frame]).value metric_value = "Gitlab::Usage::Metrics::Instrumentations::#{instrumentation_class}".constantize.new(time_frame: definition.attributes[:time_frame]).value
metric_payload(definition.key_path, metric_value) metric_payload(definition.key_path, metric_value)
else else
......
...@@ -69,8 +69,8 @@ RSpec.describe Gitlab::Usage::MetricDefinition do ...@@ -69,8 +69,8 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
:tier | %w(test ee) :tier | %w(test ee)
:name | 'count_<adjective_describing>_boards' :name | 'count_<adjective_describing>_boards'
:instrumentation_class | 'Gitlab::Usage::Metrics::Instrumentations::Metric_Class' :instrumentation_class | 'Metric_Class'
:instrumentation_class | 'Gitlab::Usage::Metrics::MetricClass' :instrumentation_class | 'metricClass'
end end
with_them do with_them do
......
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