From 373ab0740f212032865641beaab62ac6a091bc98 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 25 Feb 2025 11:10:42 +0100 Subject: [PATCH] Add rustdoc --- trino-lb/src/maintenance/query_count_fetcher.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trino-lb/src/maintenance/query_count_fetcher.rs b/trino-lb/src/maintenance/query_count_fetcher.rs index dd1d47d..008850f 100644 --- a/trino-lb/src/maintenance/query_count_fetcher.rs +++ b/trino-lb/src/maintenance/query_count_fetcher.rs @@ -148,6 +148,12 @@ impl QueryCountFetcher { } } + /// Update the query counter for the given cluster. + /// + /// In case the cluster should be reachable, we fetch the current counter and store that. + /// In case we know there is no point in fetching the counter (as e.g. the cluster is turned off), we store a query + /// count of zero (0) to avoid having dangling clusters with non-zero query counts (when in fact they are not + /// executing any query at all). #[instrument(skip(self, cluster), fields(cluster_name = cluster.name))] async fn process_cluster(&self, cluster: &TrinoClusterConfig, state: ClusterState) { match state {