Class: Gitlab::UsageDataCounters::KubernetesAgentCounter

Inherits:
BaseCounter
  • Object
show all
Defined in:
lib/gitlab/usage_data_counters/kubernetes_agent_counter.rb

Constant Summary collapse

PREFIX =
'kubernetes_agent'
KNOWN_EVENTS =
%w[gitops_sync k8s_api_proxy_request].freeze

Constants inherited from BaseCounter

BaseCounter::UnknownEvent

Class Method Summary collapse

Methods inherited from BaseCounter

count, fallback_totals, fetch_supported_event, read, redis_key, totals

Methods included from RedisCounter

#increment, #increment_by, #total_count

Class Method Details

.increment_event_counts(events) ⇒ Object


10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/usage_data_counters/kubernetes_agent_counter.rb', line 10

def increment_event_counts(events)
  validate!(events)

  events.each do |event, incr|
    # rather then hitting redis for this no-op, we return early
    next if incr == 0

    increment_by(redis_key(event), incr)
  end
end