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 a0e43cbcfe Add P50 and P90 RT metrics (#12156)
a0e43cbcfe is described below
commit a0e43cbcfe5fb8fd54635ef93adb08bb7fa96a51
Author: MartinDai <[email protected]>
AuthorDate: Thu May 18 15:38:52 2023 +0800
Add P50 and P90 RT metrics (#12156)
Co-authored-by: daming <[email protected]>
Co-authored-by: Albumen Kevin <[email protected]>
---
.../main/java/org/apache/dubbo/metrics/model/key/MetricsKey.java | 2 ++
.../apache/dubbo/metrics/collector/AggregateMetricsCollector.java | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/model/key/MetricsKey.java
b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/model/key/MetricsKey.java
index b6158be79a..9470f6b31b 100644
---
a/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/model/key/MetricsKey.java
+++
b/dubbo-metrics/dubbo-metrics-api/src/main/java/org/apache/dubbo/metrics/model/key/MetricsKey.java
@@ -55,6 +55,8 @@ public enum MetricsKey {
METRIC_RT_AVG("dubbo.%s.rt.milliseconds.avg", "Average Response Time"),
METRIC_RT_P99("dubbo.%s.rt.milliseconds.p99", "Response Time P99"),
METRIC_RT_P95("dubbo.%s.rt.milliseconds.p95", "Response Time P95"),
+ METRIC_RT_P90("dubbo.%s.rt.milliseconds.p90", "Response Time P90"),
+ METRIC_RT_P50("dubbo.%s.rt.milliseconds.p50", "Response Time P50"),
// register metrics key
diff --git
a/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java
b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java
index 960e19b1fd..765f33e71d 100644
---
a/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java
+++
b/dubbo-metrics/dubbo-metrics-default/src/main/java/org/apache/dubbo/metrics/collector/AggregateMetricsCollector.java
@@ -198,7 +198,11 @@ public class AggregateMetricsCollector implements
MetricsCollector<RequestEvent>
list.add(new
GaugeMetricSample<>(MetricsKey.METRIC_RT_P99.getNameByType(k.getSide()),
MetricsKey.METRIC_RT_P99.getDescription(), k.getTags(), RT, v,
value -> value.quantile(0.99)));
list.add(new
GaugeMetricSample<>(MetricsKey.METRIC_RT_P95.getNameByType(k.getSide()),
- MetricsKey.METRIC_RT_P99.getDescription(), k.getTags(), RT, v,
value -> value.quantile(0.95)));
+ MetricsKey.METRIC_RT_P95.getDescription(), k.getTags(), RT, v,
value -> value.quantile(0.95)));
+ list.add(new
GaugeMetricSample<>(MetricsKey.METRIC_RT_P90.getNameByType(k.getSide()),
+ MetricsKey.METRIC_RT_P90.getDescription(), k.getTags(), RT, v,
value -> value.quantile(0.90)));
+ list.add(new
GaugeMetricSample<>(MetricsKey.METRIC_RT_P50.getNameByType(k.getSide()),
+ MetricsKey.METRIC_RT_P50.getDescription(), k.getTags(), RT, v,
value -> value.quantile(0.50)));
});
}