Skip to content

Commit cd8d512

Browse files
authored
[APM] Review feedback from distribution + transaction metrics (#78752)
1 parent 6f33012 commit cd8d512

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

x-pack/plugins/apm/public/hooks/useTransactionDistribution.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,11 @@ export function useTransactionDistribution(urlParams: IUrlParams) {
6969
// selected sample was not found. select a new one:
7070
// sorted by total number of requests, but only pick
7171
// from buckets that have samples
72-
const bucketsSortedByPreference = response.buckets
72+
const bucketsSortedByCount = response.buckets
7373
.filter((bucket) => !isEmpty(bucket.samples))
7474
.sort((bucket) => bucket.count);
7575

76-
const preferredSample = maybe(
77-
bucketsSortedByPreference[0]?.samples[0]
78-
);
76+
const preferredSample = maybe(bucketsSortedByCount[0]?.samples[0]);
7977

8078
history.push({
8179
...history.location,

x-pack/test/apm_api_integration/basic/tests/transaction_groups/distribution.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,10 @@ export default function ApiTest({ getService }: FtrProviderContext) {
1717
const archiveName = 'apm_8.0.0';
1818
const metadata = archives_metadata[archiveName];
1919

20-
// url parameters
21-
const { start, end } = metadata;
22-
const uiFilters = {};
23-
2420
const url = `/api/apm/services/opbeans-java/transaction_groups/distribution?${qs.stringify({
25-
start,
26-
end,
27-
uiFilters,
21+
start: metadata.start,
22+
end: metadata.end,
23+
uiFilters: {},
2824
transactionName: 'APIRestController#stats',
2925
transactionType: 'request',
3026
})}`;

0 commit comments

Comments
 (0)