Skip to content

Commit

Permalink
[7.10] [APM] Scale transaction rate correctly (#82155) (#82277)
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 authored Nov 3, 2020
1 parent f6a260f commit 597e843
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 597e843

Please sign in to comment.