From 5dd3ad08a185313c9790a764f18e7cb5a06465d1 Mon Sep 17 00:00:00 2001 From: kssenii Date: Fri, 13 May 2022 18:10:07 +0200 Subject: [PATCH] Add S3Requests metric --- src/Common/CurrentMetrics.cpp | 1 + src/IO/S3/PocoHTTPClient.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/Common/CurrentMetrics.cpp b/src/Common/CurrentMetrics.cpp index 343de056dc2..fa9c60c6f79 100644 --- a/src/Common/CurrentMetrics.cpp +++ b/src/Common/CurrentMetrics.cpp @@ -92,6 +92,7 @@ M(FilesystemCacheReadBuffers, "Number of active cache buffers") \ M(CacheFileSegments, "Number of existing cache file segments") \ M(CacheDetachedFileSegments, "Number of existing detached cache file segments") \ + M(S3Requests, "S3 requests") \ namespace CurrentMetrics { diff --git a/src/IO/S3/PocoHTTPClient.cpp b/src/IO/S3/PocoHTTPClient.cpp index 9aacbda3fbf..0dcc87e6c0a 100644 --- a/src/IO/S3/PocoHTTPClient.cpp +++ b/src/IO/S3/PocoHTTPClient.cpp @@ -37,6 +37,11 @@ namespace ProfileEvents extern const Event S3WriteRequestsRedirects; } +namespace CurrentMetrics +{ + extern const Metric S3Requests; +} + namespace DB::ErrorCodes { extern const int NOT_IMPLEMENTED; @@ -160,6 +165,7 @@ void PocoHTTPClient::makeRequestInternal( }; ProfileEvents::increment(select_metric(S3MetricType::Count)); + CurrentMetrics::Increment metric_increment{CurrentMetrics::S3Requests}; try {