Module: Gitlab::Instrumentation::RedisInterceptor

Defined in:
lib/gitlab/instrumentation/redis_interceptor.rb

Constant Summary collapse

APDEX_EXCLUDE =
%w[brpop blpop brpoplpush bzpopmin bzpopmax command xread xreadgroup].freeze

Instance Method Summary collapse

Instance Method Details

#call(command) ⇒ Object



8
9
10
11
12
# File 'lib/gitlab/instrumentation/redis_interceptor.rb', line 8

def call(command)
  instrument_call([command]) do
    super
  end
end

#call_pipeline(pipeline) ⇒ Object



14
15
16
17
18
# File 'lib/gitlab/instrumentation/redis_interceptor.rb', line 14

def call_pipeline(pipeline)
  instrument_call(pipeline.commands, true) do
    super
  end
end

#readObject



25
26
27
28
29
# File 'lib/gitlab/instrumentation/redis_interceptor.rb', line 25

def read
  result = super
  measure_read_size(result) if ::RequestStore.active?
  result
end

#write(command) ⇒ Object



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

def write(command)
  measure_write_size(command) if ::RequestStore.active?
  super
end