2021-10-27 15:23:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Usage
|
|
|
|
module Metrics
|
|
|
|
module Aggregates
|
|
|
|
UNION_OF_AGGREGATED_METRICS = 'OR'
|
|
|
|
INTERSECTION_OF_AGGREGATED_METRICS = 'AND'
|
|
|
|
ALLOWED_METRICS_AGGREGATIONS = [UNION_OF_AGGREGATED_METRICS, INTERSECTION_OF_AGGREGATED_METRICS].freeze
|
|
|
|
AggregatedMetricError = Class.new(StandardError)
|
|
|
|
UnknownAggregationOperator = Class.new(AggregatedMetricError)
|
|
|
|
UnknownAggregationSource = Class.new(AggregatedMetricError)
|
|
|
|
DisallowedAggregationTimeFrame = Class.new(AggregatedMetricError)
|
2023-03-04 22:38:38 +05:30
|
|
|
UndefinedEvents = Class.new(AggregatedMetricError)
|
2021-10-27 15:23:28 +05:30
|
|
|
|
|
|
|
DATABASE_SOURCE = 'database'
|
2023-01-13 00:05:48 +05:30
|
|
|
REDIS_SOURCE = 'redis_hll'
|
2021-10-27 15:23:28 +05:30
|
|
|
|
|
|
|
SOURCES = {
|
|
|
|
DATABASE_SOURCE => Sources::PostgresHll,
|
|
|
|
REDIS_SOURCE => Sources::RedisHll
|
|
|
|
}.freeze
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|