Change the Apdex metric combine calculator (#6363)

This commit is contained in:
mrproliu 2021-02-11 15:19:32 +08:00 committed by GitHub
parent 92d0465cd8
commit fcf64a217f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -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.

View File

@ -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++;

View File

@ -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);