Commit 88de9ff0 authored by Piotr Skorupa's avatar Piotr Skorupa

Add Redis HLL metric generator

parent a429b96c
# frozen_string_literal: true
require 'rails/generators'
module Gitlab
module UsageMetricDefinition
class RedisHllGenerator < Rails::Generators::Base
desc 'Generates a metric definition .yml file with defaults for Redis HLL.'
argument :category, type: :string, desc: "Category name"
argument :event, type: :string, desc: "Event name"
def create_metrics
generate 'gitlab:usage_metric_definition', "#{key_path}_weekly --dir 7d"
generate 'gitlab:usage_metric_definition', "#{key_path}_monthly --dir 28d"
end
private
def key_path
"redis_hll_counters.#{category}.#{event}"
end
end
end
end
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