Class: Gitlab::Usage::Metrics::NamesSuggestions::Generator

Inherits:
Gitlab::UsageData show all
Defined in:
lib/gitlab/usage/metrics/names_suggestions/generator.rb

Constant Summary

Constants inherited from Gitlab::UsageData

Gitlab::UsageData::CE_MEMOIZED_VALUES, Gitlab::UsageData::MAX_GENERATION_TIME_FOR_SAAS

Constants included from TimeFrame

TimeFrame::ALL_TIME_TIME_FRAME_NAME, TimeFrame::SEVEN_DAYS_TIME_FRAME_NAME, TimeFrame::TWENTY_EIGHT_DAYS_TIME_FRAME_NAME

Constants included from Gitlab::Utils::UsageData

Gitlab::Utils::UsageData::DISTRIBUTED_HLL_FALLBACK, Gitlab::Utils::UsageData::FALLBACK, Gitlab::Utils::UsageData::HISTOGRAM_FALLBACK, Gitlab::Utils::UsageData::MAX_BUCKET_SIZE

Class Method Summary collapse

Methods inherited from Gitlab::UsageData

action_monthly_active_users, aggregated_metrics_data, components_usage_data, container_expiration_policies_usage, data, features_usage_data, features_usage_data_ce, grafana_embed_usage_data, installation_type, integrations_usage, jira_import_usage, jira_usage, license_usage_data, merge_requests_users, object_store_config, object_store_usage_data, operating_system, recorded_at, redis_hll_counters, runners_usage, successful_deployments_with_cluster, system_usage_data, system_usage_data_license, system_usage_data_monthly, system_usage_data_settings, system_usage_data_weekly, topology_usage_data, usage_activity_by_stage, usage_activity_by_stage_configure, usage_activity_by_stage_create, usage_activity_by_stage_enablement, usage_activity_by_stage_manage, usage_activity_by_stage_monitor, usage_activity_by_stage_package, usage_activity_by_stage_plan, usage_activity_by_stage_release, usage_activity_by_stage_secure, usage_activity_by_stage_verify, usage_counters, usage_data_counters, user_preferences_usage, with_duration

Methods included from TimeFrame

#monthly_time_range, #monthly_time_range_db_params, #weekly_time_range

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from Gitlab::Utils::UsageData

#add, #add_metric, #alt_usage_data, #average, #count, #distinct_count, #epics_deepest_relationship_level, #estimate_batch_distinct_count, #histogram, #jira_integration_data, #maximum_id, #measure_duration, #minimum_id, #redis_usage_data, #sum, #track_usage_event, #with_duration, #with_finished_at, #with_prometheus_client

Class Method Details

.add_metric(metric, time_frame: 'none', options: {}) ⇒ Object


13
14
15
16
17
# File 'lib/gitlab/usage/metrics/names_suggestions/generator.rb', line 13

def add_metric(metric, time_frame: 'none', options: {})
  metric_class = "Gitlab::Usage::Metrics::Instrumentations::#{metric}".constantize

  metric_class.new(time_frame: time_frame, options: options).suggested_name
end

.generate(key_path) ⇒ Object


9
10
11
# File 'lib/gitlab/usage/metrics/names_suggestions/generator.rb', line 9

def generate(key_path)
  data.deep_stringify_keys.dig(*key_path.split('.'))
end