Class: Gitlab::Instrumentation::Redis
- Inherits:
-
Object
- Object
- Gitlab::Instrumentation::Redis
- 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) unless Gitlab::Redis::Queues.instances.value?(redis_instance_class) instrumentation_class.enable_redis_cluster_validation end 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
- .detail_store ⇒ Object
- .payload ⇒ Object
- .shard_key ⇒ Object
- .storage_hash ⇒ Object
- .storage_key ⇒ Object
Methods included from RedisPayload
Class Method Details
.detail_store ⇒ Object
46 47 48 49 50 |
# File 'lib/gitlab/instrumentation/redis.rb', line 46 def detail_store STORAGES.flat_map do |storage| storage.detail_store.map { |details| details.merge(storage: storage.name.demodulize) } end end |
.payload ⇒ Object
38 39 40 |
# File 'lib/gitlab/instrumentation/redis.rb', line 38 def payload super.merge(*STORAGES.flat_map(&:payload)) end |
.shard_key ⇒ Object
34 35 36 |
# File 'lib/gitlab/instrumentation/redis.rb', line 34 def shard_key nil end |
.storage_hash ⇒ Object
42 43 44 |
# File 'lib/gitlab/instrumentation/redis.rb', line 42 def storage_hash @storage_hash ||= STORAGES.index_by { |k| k.name.demodulize } end |
.storage_key ⇒ Object
30 31 32 |
# File 'lib/gitlab/instrumentation/redis.rb', line 30 def storage_key nil end |