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 =

Actioncable has it’s separate instrumentation, but isn’t configurable in the same way as all the other instances using a class.

Class.new(RedisBase)
STORAGES =
(
  Gitlab::Redis::ALL_CLASSES.map do |redis_instance_class|
    instrumentation_class = Class.new(RedisBase)

    instrumentation_class.enable_redis_cluster_validation unless redis_instance_class == Gitlab::Redis::Queues

    const_set(redis_instance_class.store_name, instrumentation_class)
    instrumentation_class
  end << ActionCable
).freeze
QUERY_TIME_BUCKETS =

Milliseconds represented in seconds

[0.1, 0.25, 0.5].freeze

Class Method Summary collapse

Methods included from RedisPayload

payload

Class Method Details

.detail_storeObject



36
37
38
39
40
# File 'lib/gitlab/instrumentation/redis.rb', line 36

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

.payloadObject



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

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

.storage_keyObject



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

def storage_key
  nil
end