Commit 22cb3987 authored by Nikolay Belokolodov's avatar Nikolay Belokolodov Committed by Igor Drozdov

Add licensee metrics (EE)

parent 8f73123e
---
key_path: licensee.Email
description: Email on the GitLab license
product_section: fulfillment
product_stage: fulfillment
product_group: group::license
product_category: license
value_type: string
status: active
time_frame: none
data_source: license
data_category: subscription
distribution:
- ee
tier:
- premium
- ultimate
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/557
performance_indicator_type: []
milestone: "<13.9"
---
key_path: licensee.Company
description: Company on the GitLab license
product_section: fulfillment
product_stage: fulfillment
product_group: group::license
product_category: license
value_type: string
status: active
time_frame: none
data_source: license
data_category: subscription
distribution:
- ee
tier:
- premium
- ultimate
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/557
performance_indicator_type: []
milestone: "<13.9"
---
key_path: licensee.Name
description: Name on the GitLab license
key_path: licensee
description: Licensee Information
product_section: fulfillment
product_stage: fulfillment
product_group: group::license
product_category: license
value_type: string
value_type: object
instrumentation_class: LicenseeMetrics
status: active
time_frame: none
milestone: "14.4"
introduced_by_url:
data_source: license
time_frame: none
data_category: subscription
distribution:
- ee
- ee
tier:
- premium
- ultimate
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/557
- premium
- ultimate
performance_indicator_type: []
milestone: "<13.9"
value_json_schema: "ee/config/metrics/object_schemas/licensee.json"
{
"type": "object",
"properties": {
"Name": {
"type": "string",
"description": "Name on the GitLab license"
},
"Email": {
"type": "string",
"description": "Email on the GitLab license"
},
"Company": {
"type": "string",
"description": "Company on the GitLab license"
}
}
}
......@@ -95,7 +95,7 @@ module EE
# rubocop: disable UsageData/LargeTable
usage_data[:historical_max_users] = license.historical_max
# rubocop: enable UsageData/LargeTable
usage_data[:licensee] = license.licensee
usage_data[:licensee] = add_metric("LicenseeMetrics")
usage_data[:license_user_count] = license.restricted_user_count
usage_data[:license_billable_users] = alt_usage_data { license.daily_billable_users_count }
usage_data[:license_starts_at] = license.starts_at
......
# frozen_string_literal: true
module Gitlab
module Usage
module Metrics
module Instrumentations
class LicenseeMetrics < ::Gitlab::Usage::Metrics::Instrumentations::GenericMetric
value do
{
"Name" => ::License.current.licensee_name,
"Company" => ::License.current.licensee_company,
"Email" => ::License.current.licensee_email
}
end
end
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Usage::Metrics::Instrumentations::LicenseeMetrics do
let(:expected_value) do
{
"Name" => ::License.current.licensee_name,
"Company" => ::License.current.licensee_company,
"Email" => ::License.current.licensee_email
}
end
it_behaves_like 'a correct instrumented metric value', { time_frame: 'none' }
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