Skip to content

Commit

Permalink
Merge pull request conductor-oss#289 from junaidHussain-clari/event-q…
Browse files Browse the repository at this point in the history
…ueue-depth

Adding event_queue_depth metric
  • Loading branch information
v1r3n authored Oct 18, 2024
2 parents e45a068 + 7602ccc commit 9436596
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ public void refreshEventQueues() {
}
});

Map<String, Map<String, Long>> eventToQueueSize = getQueueSizes();
eventToQueueSize.forEach(
(event, queueMap) -> {
Map.Entry<String, Long> queueSize = queueMap.entrySet().iterator().next();
Monitors.recordEventQueueDepth(queueSize.getKey(), queueSize.getValue());
});

LOGGER.debug("Event queues: {}", eventToQueueMap.keySet());
LOGGER.debug("Stored queue: {}", events);
LOGGER.debug("Removed queue: {}", removed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ public static void recordQueueDepth(String taskType, long size, String ownerApp)
StringUtils.defaultIfBlank(ownerApp, "unknown"));
}

public static void recordEventQueueDepth(String queueType, long size) {
gauge(classQualifier, "event_queue_depth", size, "queueType", queueType);
}

public static void recordTaskInProgress(String taskType, long size, String ownerApp) {
gauge(
classQualifier,
Expand Down

0 comments on commit 9436596

Please sign in to comment.