Skip to content

Commit f1d93ea

Browse files
committed
[APM] Scale transaction rate correctly
1 parent b0a223e commit f1d93ea

File tree

3 files changed

+379
-101
lines changed

3 files changed

+379
-101
lines changed

x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ export function getTpmBuckets({
5858
const buckets = transactionResultBuckets.map(
5959
({ key: resultKey, timeseries }) => {
6060
const dataPoints = timeseries.buckets.map((bucket) => {
61-
// calculate request/minute. Avoid up-scaling numbers if bucketSize is below 60s (1 minute).
62-
// Eg. 1 request during a 10 second window should be displayed as "1 rpm" instead of "6 rpm".
63-
const tmpValue = bucket.count.value * (60 / Math.max(60, bucketSize));
6461
return {
6562
x: bucket.key,
66-
y: tmpValue,
63+
// divide by minutes
64+
y: bucket.count.value / (bucketSize / 60),
6765
};
6866
});
6967

0 commit comments

Comments
 (0)