This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new d4b2accff1 Change the name according to the naming convention (#11327)
d4b2accff1 is described below

commit d4b2accff1323398fabf82c7e3156f2aeaf0ad35
Author: fomeiherz <[email protected]>
AuthorDate: Thu Jan 19 10:02:13 2023 +0800

    Change the name according to the naming convention (#11327)
---
 .../metrics/collector/DefaultMetricsCollector.java |  4 ++--
 .../dubbo/common/metrics/model/MetricsKey.java     | 25 +++++++++++-----------
 .../collector/DefaultMetricsCollectorTest.java     |  2 +-
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git 
a/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollector.java
 
b/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollector.java
index bc034ccff5..0d3fc39ec0 100644
--- 
a/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollector.java
+++ 
b/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollector.java
@@ -140,7 +140,7 @@ public class DefaultMetricsCollector implements 
MetricsCollector {
 
     private void collectRequests(List<MetricSample> list) {
         doExecute(RequestEvent.Type.TOTAL, 
MetricsStatHandler::get).filter(e->!e.isEmpty())
-            .ifPresent(map-> map.forEach((k, v) -> list.add(new 
GaugeMetricSample(MetricsKey.PROVIDER_METRIC_REQUESTS_TOTAL, k.getTags(), 
REQUESTS, v::get))));
+            .ifPresent(map-> map.forEach((k, v) -> list.add(new 
GaugeMetricSample(MetricsKey.PROVIDER_METRIC_REQUESTS, k.getTags(), REQUESTS, 
v::get))));
 
         doExecute(RequestEvent.Type.SUCCEED, 
MetricsStatHandler::get).filter(e->!e.isEmpty())
             .ifPresent(map-> map.forEach((k, v) -> list.add(new 
GaugeMetricSample(MetricsKey.PROVIDER_METRIC_REQUESTS_SUCCEED, k.getTags(), 
REQUESTS, v::get))));
@@ -171,7 +171,7 @@ public class DefaultMetricsCollector implements 
MetricsCollector {
         this.stats.getMaxRT().forEach((k, v) -> list.add(new 
GaugeMetricSample(MetricsKey.PROVIDER_METRIC_RT_MAX, k.getTags(), RT, v::get)));
 
         this.stats.getTotalRT().forEach((k, v) -> {
-            list.add(new 
GaugeMetricSample(MetricsKey.PROVIDER_METRIC_RT_TOTAL, k.getTags(), RT, 
v::get));
+            list.add(new GaugeMetricSample(MetricsKey.PROVIDER_METRIC_RT_SUM, 
k.getTags(), RT, v::get));
 
             AtomicLong avg = this.stats.getAvgRT().get(k);
             AtomicLong count = this.stats.getRtCount().get(k);
diff --git 
a/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/model/MetricsKey.java
 
b/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/model/MetricsKey.java
index 28f19c7c48..3defc6a47e 100644
--- 
a/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/model/MetricsKey.java
+++ 
b/dubbo-common/src/main/java/org/apache/dubbo/common/metrics/model/MetricsKey.java
@@ -20,10 +20,10 @@ package org.apache.dubbo.common.metrics.model;
 public enum MetricsKey {
 
     // provider metrics key
-    PROVIDER_METRIC_REQUESTS_TOTAL("dubbo.provider.requests.total", "Total 
Requests"),
-    PROVIDER_METRIC_REQUESTS_SUCCEED("dubbo.provider.requests.succeed", 
"Succeed Requests"),
-    PROVIDER_METRIC_REQUESTS_FAILED("dubbo.provider.requests.failed", "Failed 
Requests"),
-    
PROVIDER_METRIC_REQUEST_BUSINESS_FAILED("dubbo.provider.requests.business.failed","Failed
 Business Requests"),
+    PROVIDER_METRIC_REQUESTS("dubbo.provider.requests.total", "Total 
Requests"),
+    PROVIDER_METRIC_REQUESTS_SUCCEED("dubbo.provider.requests.succeed.total", 
"Succeed Requests"),
+    PROVIDER_METRIC_REQUESTS_FAILED("dubbo.provider.requests.failed.total", 
"Failed Requests"),
+    
PROVIDER_METRIC_REQUEST_BUSINESS_FAILED("dubbo.provider.requests.business.failed.total","Failed
 Business Requests"),
     PROVIDER_METRIC_REQUESTS_PROCESSING("dubbo.provider.requests.processing", 
"Processing Requests"),
 
     
PROVIDER_METRIC_REQUESTS_TOTAL_AGG("dubbo.provider.requests.total.aggregate", 
"Aggregated Total Requests"),
@@ -33,14 +33,15 @@ public enum MetricsKey {
     
PROVIDER_METRIC_REQUESTS_TIMEOUT_AGG("dubbo.provider.requests.timeout.failed.aggregate",
 "Aggregated timeout Failed Requests"),
     
PROVIDER_METRIC_REQUESTS_LIMIT_AGG("dubbo.provider.requests.limit.aggregate", 
"Aggregated limit Requests"),
     
PROVIDER_METRIC_REQUESTS_TOTAL_FAILED_AGG("dubbo.provider.requests.failed.total.aggregate",
 "Aggregated failed total Requests"),
-    PROVIDER_METRIC_QPS("dubbo.provider.qps", "Query Per Seconds"),
-    PROVIDER_METRIC_RT_LAST("dubbo.provider.rt.last", "Last Response Time"),
-    PROVIDER_METRIC_RT_MIN("dubbo.provider.rt.min", "Min Response Time"),
-    PROVIDER_METRIC_RT_MAX("dubbo.provider.rt.max", "Max Response Time"),
-    PROVIDER_METRIC_RT_TOTAL("dubbo.provider.rt.total", "Total Response Time"),
-    PROVIDER_METRIC_RT_AVG("dubbo.provider.rt.avg", "Average Response Time"),
-    PROVIDER_METRIC_RT_P99("dubbo.provider.rt.p99", "Response Time P99"),
-    PROVIDER_METRIC_RT_P95("dubbo.provider.rt.p95", "Response Time P95"),
+
+    PROVIDER_METRIC_QPS("dubbo.provider.qps.seconds", "Query Per Seconds"),
+    PROVIDER_METRIC_RT_LAST("dubbo.provider.rt.seconds.last", "Last Response 
Time"),
+    PROVIDER_METRIC_RT_MIN("dubbo.provider.rt.seconds.min", "Min Response 
Time"),
+    PROVIDER_METRIC_RT_MAX("dubbo.provider.rt.seconds.max", "Max Response 
Time"),
+    PROVIDER_METRIC_RT_SUM("dubbo.provider.rt.seconds.sum", "Sum Response 
Time"),
+    PROVIDER_METRIC_RT_AVG("dubbo.provider.rt.seconds.avg", "Average Response 
Time"),
+    PROVIDER_METRIC_RT_P99("dubbo.provider.rt.seconds.p99", "Response Time 
P99"),
+    PROVIDER_METRIC_RT_P95("dubbo.provider.rt.seconds.p95", "Response Time 
P95"),
 
     // consumer metrics key
     ;
diff --git 
a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
 
b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
index ddc30d5c68..11001a8a62 100644
--- 
a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
+++ 
b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
@@ -129,7 +129,7 @@ class DefaultMetricsCollectorTest {
         
Assertions.assertEquals(sampleMap.get(MetricsKey.PROVIDER_METRIC_RT_MIN.getName()),
 0L);
         
Assertions.assertEquals(sampleMap.get(MetricsKey.PROVIDER_METRIC_RT_MAX.getName()),
 10L);
         
Assertions.assertEquals(sampleMap.get(MetricsKey.PROVIDER_METRIC_RT_AVG.getName()),
 5L);
-        
Assertions.assertEquals(sampleMap.get(MetricsKey.PROVIDER_METRIC_RT_TOTAL.getName()),
 10L);
+        
Assertions.assertEquals(sampleMap.get(MetricsKey.PROVIDER_METRIC_RT_SUM.getName()),
 10L);
     }
 
     @Test

Reply via email to