From 25b6efc8e835c66ce00edb1ac07ecab787a126eb Mon Sep 17 00:00:00 2001 From: Hanyang Ke Date: Sun, 19 Apr 2020 11:12:01 +0800 Subject: [PATCH] fix warning (#1988) Signed-off-by: kehycs --- core/src/metrics/Metrics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/metrics/Metrics.h b/core/src/metrics/Metrics.h index 42f5ae4ba2..09df67596b 100644 --- a/core/src/metrics/Metrics.h +++ b/core/src/metrics/Metrics.h @@ -61,7 +61,7 @@ class CollectInsertMetrics : CollectMetricsBase { if (n_ > 0) { auto total_time = TimeFromBegine(); double avg_time = total_time / n_; - for (int i = 0; i < n_; ++i) { + for (size_t i = 0; i < n_; ++i) { Metrics::GetInstance().AddVectorsDurationHistogramOberve(avg_time); } @@ -90,7 +90,7 @@ class CollectQueryMetrics : CollectMetricsBase { ~CollectQueryMetrics() { if (nq_ > 0) { auto total_time = TimeFromBegine(); - for (int i = 0; i < nq_; ++i) { + for (size_t i = 0; i < nq_; ++i) { server::Metrics::GetInstance().QueryResponseSummaryObserve(total_time); } auto average_time = total_time / nq_;