Commit 22376a8e authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'mwaw/remove_broken_events_metric_from_service_ping' into 'master'

Mark all time events ServicePing metric as broken

See merge request gitlab-org/gitlab!73266
parents 871ef67a 3af1f00f
......@@ -7,7 +7,8 @@ product_stage: manage
product_group: group::manage
product_category:
value_type: number
status: active
status: broken
repair_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/344100
time_frame: all
data_source: database
distribution:
......
......@@ -537,8 +537,7 @@ module Gitlab
def usage_activity_by_stage_manage(time_period)
{
# rubocop: disable UsageData/LargeTable
events: estimate_batch_distinct_count(::Event.where(time_period), :author_id),
# rubocop: enable UsageData/LargeTable
events: stage_manage_events(time_period),
groups: distinct_count(::GroupMember.where(time_period), :user_id),
users_created: count(::User.where(time_period), start: minimum_id(User), finish: maximum_id(User)),
omniauth_providers: filtered_omniauth_provider_names.reject { |name| name == 'group_saml' },
......@@ -718,6 +717,18 @@ module Gitlab
private
def stage_manage_events(time_period)
if time_period.empty?
Gitlab::Utils::UsageData::FALLBACK
else
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable UsageData/LargeTable
estimate_batch_distinct_count(::Event.where(time_period), :author_id)
# rubocop: enable UsageData/LargeTable
# rubocop: enable CodeReuse/ActiveRecord
end
end
def usage_data_metrics
license_usage_data
.merge(system_usage_data_license)
......
......@@ -215,7 +215,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
end
expect(described_class.usage_activity_by_stage_manage({})).to include(
events: be_within(error_rate).percent_of(2),
events: -1,
groups: 2,
users_created: 6,
omniauth_providers: ['google_oauth2'],
......
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