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
status: data_available
time_frame: 28d
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric'
instrumentation_class: CountUsersCreatingIssuesMetric
distribution:
- ce
- ee
......
......@@ -9,7 +9,7 @@ value_type: number
status: data_available
time_frame: 28d
data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric'
instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution:
- ce
- ee
......
......@@ -9,7 +9,7 @@ value_type: number
status: data_available
time_frame: 7d
data_source: redis_hll
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersUsingApproveQuickActionMetric'
instrumentation_class: CountUsersUsingApproveQuickActionMetric
distribution:
- ce
- ee
......
......@@ -9,7 +9,7 @@ value_type: number
status: data_available
time_frame: all
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountIssuesMetric'
instrumentation_class: CountIssuesMetric
distribution:
- ce
- ee
......
......@@ -9,7 +9,7 @@ value_type: number
status: data_available
time_frame: all
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountUsersCreatingIssuesMetric'
instrumentation_class: CountUsersCreatingIssuesMetric
distribution:
- ce
- ee
......
......@@ -9,7 +9,7 @@ value_type: number
status: data_available
time_frame: all
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::CountBoardsMetric'
instrumentation_class: CountBoardsMetric
distribution:
- ce
- ee
......
......@@ -11,7 +11,7 @@ milestone: "9.1"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1521
time_frame: none
data_source: database
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::UuidMetric'
instrumentation_class: UuidMetric
distribution:
- ee
- ce
......
......@@ -9,7 +9,7 @@ value_type: string
status: data_available
time_frame: none
data_source: system
instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::HostnameMetric'
instrumentation_class: HostnameMetric
distribution:
- ce
- ee
......
......@@ -56,7 +56,7 @@
},
"instrumentation_class": {
"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": {
"type": "array",
......
......@@ -9,7 +9,7 @@ module Gitlab
instrumentation_class = definition.attributes[:instrumentation_class]
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)
else
......
......@@ -69,8 +69,8 @@ RSpec.describe Gitlab::Usage::MetricDefinition do
:tier | %w(test ee)
:name | 'count_<adjective_describing>_boards'
:instrumentation_class | 'Gitlab::Usage::Metrics::Instrumentations::Metric_Class'
:instrumentation_class | 'Gitlab::Usage::Metrics::MetricClass'
:instrumentation_class | 'Metric_Class'
:instrumentation_class | 'metricClass'
end
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