Skip to content

Commit

Permalink
[7.x] [APM] Scale transaction rate correctly (#82155) (#82276)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
dgieselaar and kibanamachine committed Nov 3, 2020
1 parent 0d88b5f commit 97f6f0c
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 97f6f0c

Please sign in to comment.