2021-03-25 17:09:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
class UsageDataNonSqlMetrics < UsageData
|
|
|
|
SQL_METRIC_DEFAULT = -3
|
|
|
|
|
|
|
|
class << self
|
2021-10-28 05:13:54 -04:00
|
|
|
def add_metric(metric, time_frame: 'none', options: {})
|
2021-07-21 11:08:52 -04:00
|
|
|
metric_class = "Gitlab::Usage::Metrics::Instrumentations::#{metric}".constantize
|
|
|
|
|
2021-10-28 05:13:54 -04:00
|
|
|
metric_class.new(time_frame: time_frame, options: options).instrumentation
|
2021-07-21 11:08:52 -04:00
|
|
|
end
|
|
|
|
|
2021-03-25 17:09:13 -04:00
|
|
|
def count(relation, column = nil, batch: true, batch_size: nil, start: nil, finish: nil)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
|
|
|
|
|
|
|
def distinct_count(relation, column = nil, batch: true, batch_size: nil, start: nil, finish: nil)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
|
|
|
|
|
|
|
def estimate_batch_distinct_count(relation, column = nil, batch_size: nil, start: nil, finish: nil)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
|
|
|
|
|
|
|
def sum(relation, column, batch_size: nil, start: nil, finish: nil)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
|
|
|
|
|
|
|
def histogram(relation, column, buckets:, bucket_size: buckets.size)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
2021-04-15 11:09:11 -04:00
|
|
|
|
2022-05-16 11:08:39 -04:00
|
|
|
def add(*args)
|
|
|
|
SQL_METRIC_DEFAULT
|
|
|
|
end
|
|
|
|
|
2021-04-21 11:09:35 -04:00
|
|
|
def maximum_id(model, column = nil)
|
2021-04-15 11:09:11 -04:00
|
|
|
end
|
|
|
|
|
2021-04-21 11:09:35 -04:00
|
|
|
def minimum_id(model, column = nil)
|
|
|
|
end
|
|
|
|
|
2021-06-18 11:10:16 -04:00
|
|
|
def jira_integration_data
|
2021-04-21 11:09:35 -04:00
|
|
|
{
|
|
|
|
projects_jira_server_active: 0,
|
|
|
|
projects_jira_cloud_active: 0
|
|
|
|
}
|
2021-04-15 11:09:11 -04:00
|
|
|
end
|
2021-03-25 17:09:13 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|