Commit 3af1f00f authored by Mikolaj Wawrzyniak's avatar Mikolaj Wawrzyniak

Mark all time events ServicePing metric as broken

Manage events metric calcualted for all time, time fram takes over 40
hours to complete for gitlab.com, this is almost 4 times as all the
other metrics combined, this creates a risk of preventing
service ping reporitng process to complete on time. Therfore this
metric is marked as broken and excluded from reporting

Changelog: other
parent bba84895
......@@ -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