Skip to content

Commit 1e526f4

Browse files
syzhyugasun
authored andcommitted
fix: api latency total value to max
1 parent 56fe3cd commit 1e526f4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/baas/metrics/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ class Metrics {
420420
latency.x.values = requestDatas.Values.map((item) => {
421421
return item.Timestamp * 1000
422422
})
423-
latency.y.push(makeMetric('p95 latency', latencyP95Datas))
423+
const p95Obj = makeMetric('p95 latency', latencyP95Datas)
424+
p95Obj.total = Math.max(...p95Obj.values)
425+
latency.y.push(p95Obj)
424426
}
425427

426428
if (latencyP50Datas) {
@@ -434,7 +436,9 @@ class Metrics {
434436
latency.x.values = requestDatas.Values.map((item) => {
435437
return item.Timestamp * 1000
436438
})
437-
latency.y.push(makeMetric('p50 latency', latencyP50Datas))
439+
const p50Obj = makeMetric('p50 latency', latencyP50Datas)
440+
p50Obj.total = Math.max(...p50Obj.values)
441+
latency.y.push(p50Obj)
438442
}
439443
}
440444

0 commit comments

Comments
 (0)