Skip to content

Commit

Permalink
[APM] Scale transaction rate correctly (elastic#82155)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
dgieselaar and kibanamachine committed Nov 2, 2020
1 parent 9d3583e commit 3c57090
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 3c57090

Please sign in to comment.