Skip to content

Add RedisMetric instrumentation class

What does this MR do?

Related to #332487 (closed).

This adds RedisMetric instrumentation class, which adds ordinary Redis counter values to the new instrumentation payload in a similar way RedisHLLMetric does.

After incrementing source_code_pushes event by calling Gitlab::UsageDataCounters::SourceCodeCounter.count('pushes') a few times, the new instrumentation payload from Gitlab::UsageDataMetrics.uncached_data is as follows:

{:counts=>{:issues=>491, :boards=>0, :source_code_pushes=>3},
 :usage_activity_by_stage=>{:plan=>{:issues=>20}},
 :usage_activity_by_stage_monthly=>{:plan=>{:issues=>20}},
 :redis_hll_counters=>{:quickactions=>{:i_quickactions_approve_monthly=>0, :i_quickactions_approve_weekly=>0}},
 :settings=>{:collected_data_categories=>#<Set: {"Standard", "Subscription", "Operational", "Optional"}>},
 :uuid=>"4aed0f2d-a225-4a10-adb2-7f7e316e6930",
 :hostname=>"gdk.test"}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Piotr Skorupa

Merge request reports

Loading