Skip to content

Commit

Permalink
fix: Clean up redis bus lag
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed Mar 22, 2024
1 parent eff8207 commit 7ef20ee
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7ef20ee

Please sign in to comment.