Skip to content

Commit

Permalink
[APM] Fixes incorrect throughput tpm values in service overview (elas…
Browse files Browse the repository at this point in the history
…tic#88273)

* Closes elastic#88268. Divides the throughput count of the selected range by deltaAsMinutes

* update old test snapshot

* update values in test snapshot

* update values in test snapshot

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
ogupte and kibanamachine committed Jan 14, 2021
1 parent f286eb9 commit 1412dfb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export async function getServiceInstanceTransactionStats({
},
});

const deltaAsMinutes = (end - start) / 60 / 1000;

return (
response.aggregations?.[SERVICE_NODE_NAME].buckets.map(
(serviceNodeBucket) => {
Expand All @@ -133,10 +135,10 @@ export async function getServiceInstanceTransactionStats({
})),
},
throughput: {
value: count.value,
value: count.value / deltaAsMinutes,
timeseries: timeseries.buckets.map((dateBucket) => ({
x: dateBucket.key,
y: dateBucket.count.value,
y: dateBucket.count.value / deltaAsMinutes,
})),
},
latency: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export async function getTransactionGroupsForPage({
transactionType: string;
latencyAggregationType: LatencyAggregationType;
}) {
const deltaAsMinutes = (end - start) / 1000 / 60;

const field = getTransactionDurationFieldForAggregatedTransactions(
searchAggregatedTransactions
);
Expand Down Expand Up @@ -122,7 +124,7 @@ export async function getTransactionGroupsForPage({
latencyAggregationType,
aggregation: bucket.latency,
}),
throughput: bucket.transaction_count.value,
throughput: bucket.transaction_count.value / deltaAsMinutes,
errorRate,
};
}) ?? [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
"value": 0.941324615478516,
},
"throughput": Object {
"value": 75,
"value": 2.5,
},
}
`);
Expand Down Expand Up @@ -201,7 +201,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
"value": 70518.9328358209,
},
"throughput": Object {
"value": 134,
"value": 4.46666666666667,
},
}
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function ApiTest({ getService }: FtrProviderContext) {
},
"name": "DispatcherServlet#doGet",
"throughput": Object {
"value": 16,
"value": 0.533333333333333,
},
}
`);
Expand Down

0 comments on commit 1412dfb

Please sign in to comment.