diff --git a/CHANGES.md b/CHANGES.md index 38e4a52320324782a45a8d26191ebf032e0e4836..91c2f77b69b72a6e66318b49d8e54d70ec03d83f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Release Notes. * Add some defensive codes for NPE and bump up Kubernetes client version to expose exception stack trace. * Update the `timestamp` field type for `LogQuery`. * Support Zabbix protocol to receive agent metrics. +* Update the Apdex metric combine calculator. #### UI * Update selector scroller to show in all pages. diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetrics.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetrics.java index 4cf4d25d44d18d0c4c2406026bf830ef99dfe478..14b4750bc8b65a9abfc6b4dfdf3109b775588f09 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetrics.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetrics.java @@ -68,10 +68,10 @@ public abstract class ApdexMetrics extends Metrics implements IntValueHolder { int t = DICT.lookup(name).intValue(); int t4 = t * 4; totalNum++; - if (!status || value >= t4) { + if (!status || value > t4) { return; } - if (value >= t) { + if (value > t) { tNum++; } else { sNum++; diff --git a/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetricsTest.java b/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetricsTest.java index c9c5c39a0953e90fb9c219392a79ac585256b4aa..cd347c5db5c38dfe8d6ae24e01153a91ca5a5f97 100644 --- a/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetricsTest.java +++ b/oap-server/server-core/src/test/java/org/apache/skywalking/oap/server/core/analysis/metrics/ApdexMetricsTest.java @@ -47,7 +47,7 @@ public class ApdexMetricsTest { apdex = new ApdexMetricsImpl(); apdex.combine(2000, "foo", true); apdex.calculate(); - assertThat(apdex.getValue(), is(0)); + assertThat(apdex.getValue(), is(5000)); apdex = new ApdexMetricsImpl(); apdex.combine(200, "foo", true);