Class: Gitlab::Instrumentation::Redis

Inherits:
Object
  • Object
show all
Extended by:
RedisPayload
Defined in:
lib/gitlab/instrumentation/redis.rb

Overview

Aggregates Redis measurements from different request storage sources.

Constant Summary collapse

ActionCable =
Class.new(RedisBase)
Cache =
Class.new(RedisBase).enable_redis_cluster_validation
Queues =
Class.new(RedisBase)
SharedState =
Class.new(RedisBase).enable_redis_cluster_validation
STORAGES =
[ActionCable, Cache, Queues, SharedState].freeze
QUERY_TIME_BUCKETS =

Milliseconds represented in seconds (from 1 millisecond to 2 seconds).

[0.001, 0.0025, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2].freeze

Class Method Summary collapse

Methods included from RedisPayload

known_payload_keys, payload

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Class Method Details

.detail_storeObject


32
33
34
35
36
# File 'lib/gitlab/instrumentation/redis.rb', line 32

def detail_store
  STORAGES.flat_map do |storage|
    storage.detail_store.map { |details| details.merge(storage: storage.name.demodulize) }
  end
end

.known_payload_keysObject


24
25
26
# File 'lib/gitlab/instrumentation/redis.rb', line 24

def known_payload_keys
  super + STORAGES.flat_map(&:known_payload_keys)
end

.payloadObject


28
29
30
# File 'lib/gitlab/instrumentation/redis.rb', line 28

def payload
  super.merge(*STORAGES.flat_map(&:payload))
end

.storage_keyObject


20
21
22
# File 'lib/gitlab/instrumentation/redis.rb', line 20

def storage_key
  nil
end