Skip to content

Commit

Permalink
[APM] Scale transaction rate correctly (#82155)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
dgieselaar and kibanamachine authored Nov 2, 2020
1 parent 7002250 commit 0327601
Show file tree
Hide file tree
Showing 3 changed files with 379 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ export function getTpmBuckets({
const buckets = transactionResultBuckets.map(
({ key: resultKey, timeseries }) => {
const dataPoints = timeseries.buckets.map((bucket) => {
// calculate request/minute. Avoid up-scaling numbers if bucketSize is below 60s (1 minute).
// Eg. 1 request during a 10 second window should be displayed as "1 rpm" instead of "6 rpm".
const tmpValue = bucket.count.value * (60 / Math.max(60, bucketSize));
return {
x: bucket.key,
y: tmpValue,
// divide by minutes
y: bucket.count.value / (bucketSize / 60),
};
});

Expand Down
Loading

0 comments on commit 0327601

Please sign in to comment.