From 7ef20ee0dd79526bbac63eb7ce06798dacb47018 Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Fri, 22 Mar 2024 07:27:02 -0400 Subject: [PATCH] fix: Clean up redis bus lag --- .../management/commands/monitor_load_test_tracking.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py b/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py index c32f280..da6fd35 100644 --- a/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py +++ b/platform_plugin_aspects/management/commands/monitor_load_test_tracking.py @@ -166,16 +166,16 @@ def get_redis_bus_stats(self): r = redis.Redis.from_url(settings.EVENT_BUS_REDIS_CONNECTION_URL) info = r.xinfo_stream("openedx-analytics", full=True) - lag = [] + lag = 0 for g in info["groups"]: - lag.append({str(g["name"]): g["lag"]}) + lag += g["lag"] consumer_stats = { "total_events": info["length"], - "queue_lengths": lag, + "groups_total_lag": lag, } - log.info(f"Redis bus queue length: {consumer_stats['queue_lengths']}") + log.info(f"Redis bus queue length: {consumer_stats['groups_total_lag']}") return consumer_stats