From c219ffd8fa4856d5123c18c8aea9f031c0c4e5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Wed, 8 Jan 2025 17:53:28 +0100 Subject: [PATCH] Expose worker tracked tasks count --- .../src/main/java/io/trino/execution/SqlTaskManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlTaskManager.java b/core/trino-main/src/main/java/io/trino/execution/SqlTaskManager.java index 677124297b5..80c4481091f 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlTaskManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlTaskManager.java @@ -359,6 +359,12 @@ public ThreadPoolExecutorMBean getTaskNotificationExecutor() return taskNotificationExecutorMBean; } + @Managed(description = "Tracked tasks count") + public long getTrackedTasksCount() + { + return tasks.size(); + } + @Managed(description = "Created tasks counter") @Nested public CounterStat getCreatedTasks()