Skip to content

Add pipelined Redis commands to performance bar

Heinrich Lee Yu requested to merge redis-intercept-pipelined-commands into master

What does this MR do and why?

This also includes them in redis_calls, redis_duration_s, and other related fields in the logs.

Related to gitlab-com/gl-infra/scalability#1846 (closed)

Screenshots or screen recordings

Screen_Shot_2022-08-05_at_9.51.16_PM

How to set up and validate locally

  1. Visit a project's page (http://127.0.0.1:3000/flightjs/Flight)

  2. In the Redis section of the performance bar, you should see:

    Screen_Shot_2022-08-05_at_10.01.55_PM

For easier testing, I also tried something like this:

diff --git a/app/controllers/dashboard/todos_controller.rb b/app/controllers/dashboard/todos_controller.rb
index d2434d4b0ba..0b8ebb13922 100644
--- a/app/controllers/dashboard/todos_controller.rb
+++ b/app/controllers/dashboard/todos_controller.rb
@@ -12,6 +12,9 @@ class Dashboard::TodosController < Dashboard::ApplicationController
   urgency :low

   def index
+    Gitlab::Redis::Cache.with { |r| r.pipelined { |rr| rr.get('key1'); rr.get('key2'); } }
+    Gitlab::Redis::Cache.with { |r| r.multi { |rr| rr.set('key1', 'test'); rr.set('key2', 'test'); } }
+
     @sort = params[:sort]
     @todos = @todos.page(params[:page])
     @todos = @todos.with_entity_associations

Just to force a URL to do some pipelined calls.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports

Loading