Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
commit5afcbe03ead9ada87621888a31a62652b10a7e4f (patch)
tree9918b67a0d0f0bafa6542e839a8be37adf73102d /lib/gitlab/instrumentation
parentc97c0201564848c1f53226fe19d71fdcc472f7d0 (diff)
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'lib/gitlab/instrumentation')
-rw-r--r--lib/gitlab/instrumentation/redis_base.rb10
-rw-r--r--lib/gitlab/instrumentation/redis_interceptor.rb5
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/gitlab/instrumentation/redis_base.rb b/lib/gitlab/instrumentation/redis_base.rb
index 70aaa59f912..e39bbb36680 100644
--- a/lib/gitlab/instrumentation/redis_base.rb
+++ b/lib/gitlab/instrumentation/redis_base.rb
@@ -110,6 +110,16 @@ module Gitlab
@request_counter.increment({ storage: storage_key }, amount)
end
+ def instance_count_pipelined_request(size)
+ @pipeline_size_histogram ||= Gitlab::Metrics.histogram(
+ :gitlab_redis_client_requests_pipelined_commands,
+ 'Client side Redis request pipeline size, per Redis server',
+ {},
+ [10, 100, 1000, 10_000]
+ )
+ @pipeline_size_histogram.observe({ storage: storage_key }, size)
+ end
+
def instance_count_exception(ex)
# This metric is meant to give a client side view of how the Redis
# server is doing. Redis itself does not expose error counts. This
diff --git a/lib/gitlab/instrumentation/redis_interceptor.rb b/lib/gitlab/instrumentation/redis_interceptor.rb
index b3fbe30e583..20ba1ab82a7 100644
--- a/lib/gitlab/instrumentation/redis_interceptor.rb
+++ b/lib/gitlab/instrumentation/redis_interceptor.rb
@@ -12,7 +12,7 @@ module Gitlab
end
def call_pipeline(pipeline)
- instrument_call(pipeline.commands) do
+ instrument_call(pipeline.commands, true) do
super
end
end
@@ -30,9 +30,10 @@ module Gitlab
private
- def instrument_call(commands)
+ def instrument_call(commands, pipelined = false)
start = Gitlab::Metrics::System.monotonic_time # must come first so that 'start' is always defined
instrumentation_class.instance_count_request(commands.size)
+ instrumentation_class.instance_count_pipelined_request(commands.size) if pipelined
if !instrumentation_class.redis_cluster_validate!(commands) && ::RequestStore.active?
instrumentation_class.increment_cross_slot_request_count