Skip to content

Commit

Permalink
Renamed “durationSum” to “sum” and went back to single, mutable impact
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Dec 3, 2018
1 parent 4a2cc02 commit 9ed6ad0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ Array [
"field": "transaction.duration.us",
},
},
"durationSum": Object {
"sum": Object {
"field": "transaction.duration.us",
},
},
"p95": Object {
"percentiles": Object {
"field": "transaction.duration.us",
Expand All @@ -42,11 +37,16 @@ Array [
],
},
},
"sum": Object {
"sum": Object {
"field": "transaction.duration.us",
},
},
},
"terms": Object {
"field": "transaction.name.keyword",
"order": Object {
"durationSum": "desc",
"sum": "desc",
},
"size": 100,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
exports[`transactionGroupsTransformer should match snapshot 1`] = `
Array [
Object {
"absoluteImpact": 46073935,
"averageResponseTime": 255966.30555555556,
"impact": 4.3693406535517445,
"name": "POST /api/orders",
Expand Down Expand Up @@ -129,7 +128,6 @@ baz",
"transactionsPerMinute": 5684.210526315789,
},
Object {
"absoluteImpact": 1052209442,
"averageResponseTime": 48021.972616494,
"impact": 100,
"name": "GET /api",
Expand Down Expand Up @@ -256,7 +254,6 @@ baz",
"transactionsPerMinute": 691926.3157894736,
},
Object {
"absoluteImpact": 108011563,
"averageResponseTime": 33265.03326147213,
"impact": 10.256357027376065,
"name": "GET /api/orders",
Expand Down Expand Up @@ -378,7 +375,6 @@ baz",
"transactionsPerMinute": 102536.84210526315,
},
Object {
"absoluteImpact": 23030509,
"averageResponseTime": 32900.72714285714,
"impact": 2.1791207411745854,
"name": "GET /log-message",
Expand Down Expand Up @@ -500,7 +496,6 @@ baz",
"transactionsPerMinute": 22105.263157894737,
},
Object {
"absoluteImpact": 151019688,
"averageResponseTime": 32554.36257814184,
"impact": 14.344171563678346,
"name": "GET /api/stats",
Expand Down Expand Up @@ -628,7 +623,6 @@ baz",
"transactionsPerMinute": 146494.73684210525,
},
Object {
"absoluteImpact": 23837374,
"averageResponseTime": 32387.73641304348,
"impact": 2.2558112380477584,
"name": "GET /log-error",
Expand Down Expand Up @@ -750,7 +744,6 @@ baz",
"transactionsPerMinute": 23242.105263157893,
},
Object {
"absoluteImpact": 108250312,
"averageResponseTime": 32159.926322043968,
"impact": 10.27904952170656,
"name": "GET /api/customers",
Expand Down Expand Up @@ -878,7 +871,6 @@ baz",
"transactionsPerMinute": 106294.73684210525,
},
Object {
"absoluteImpact": 101647397,
"averageResponseTime": 27516.89144558744,
"impact": 9.651458992731666,
"name": "GET /api/products/top",
Expand Down Expand Up @@ -1007,7 +999,6 @@ baz",
"transactionsPerMinute": 116652.63157894736,
},
Object {
"absoluteImpact": 3135762,
"averageResponseTime": 21331.714285714286,
"impact": 0.28817487960409877,
"name": "POST /api",
Expand Down Expand Up @@ -1131,7 +1122,6 @@ baz",
"transactionsPerMinute": 4642.105263157894,
},
Object {
"absoluteImpact": 36131970,
"averageResponseTime": 17189.329210275926,
"impact": 3.424381787142002,
"name": "GET /api/products/:id/customers",
Expand Down Expand Up @@ -1259,7 +1249,6 @@ baz",
"transactionsPerMinute": 66378.94736842105,
},
Object {
"absoluteImpact": 18494584,
"averageResponseTime": 12763.68806073154,
"impact": 1.7479924334286208,
"name": "GET /api/types/:id",
Expand Down Expand Up @@ -1381,7 +1370,6 @@ baz",
"transactionsPerMinute": 45757.8947368421,
},
Object {
"absoluteImpact": 46648776,
"averageResponseTime": 12683.190864600327,
"impact": 4.4239778504968,
"name": "GET /api/products",
Expand Down Expand Up @@ -1503,7 +1491,6 @@ baz",
"transactionsPerMinute": 116147.36842105263,
},
Object {
"absoluteImpact": 27018619,
"averageResponseTime": 11257.757916666667,
"impact": 2.558180605569336,
"name": "GET /api/types",
Expand Down Expand Up @@ -1625,7 +1612,6 @@ baz",
"transactionsPerMinute": 75789.47368421052,
},
Object {
"absoluteImpact": 13579338,
"averageResponseTime": 10584.05144193297,
"impact": 1.280810614916383,
"name": "GET /api/orders/:id",
Expand Down Expand Up @@ -1745,7 +1731,6 @@ baz",
"transactionsPerMinute": 40515.789473684206,
},
Object {
"absoluteImpact": 19398174,
"averageResponseTime": 10548.218597063622,
"impact": 1.8338763992340905,
"name": "GET /api/products/:id",
Expand Down Expand Up @@ -1867,7 +1852,6 @@ baz",
"transactionsPerMinute": 58073.68421052631,
},
Object {
"absoluteImpact": 18749614,
"averageResponseTime": 9868.217894736843,
"impact": 1.7722323960215767,
"name": "GET /api/customers/:id",
Expand Down Expand Up @@ -1995,7 +1979,6 @@ baz",
"transactionsPerMinute": 59999.99999999999,
},
Object {
"absoluteImpact": 103858,
"averageResponseTime": 5192.9,
"impact": 0,
"name": "POST unknown route",
Expand Down Expand Up @@ -2127,7 +2110,6 @@ baz",
"transactionsPerMinute": 631.578947368421,
},
Object {
"absoluteImpact": 1680454,
"averageResponseTime": 4694.005586592179,
"impact": 0.1498515000753004,
"name": "GET /is-it-coffee-time",
Expand Down Expand Up @@ -2250,7 +2232,6 @@ baz",
"transactionsPerMinute": 11305.263157894737,
},
Object {
"absoluteImpact": 1528763,
"averageResponseTime": 4549.889880952381,
"impact": 0.13543365054509587,
"name": "GET /throw-error",
Expand Down Expand Up @@ -2373,7 +2354,6 @@ baz",
"transactionsPerMinute": 10610.526315789473,
},
Object {
"absoluteImpact": 24934595,
"averageResponseTime": 3504.5108924806746,
"impact": 2.3600993453143766,
"name": "GET *",
Expand Down Expand Up @@ -2501,7 +2481,6 @@ baz",
"transactionsPerMinute": 224684.21052631576,
},
Object {
"absoluteImpact": 998256,
"averageResponseTime": 2742.4615384615386,
"impact": 0.08501028923348058,
"name": "OPTIONS unknown route",
Expand Down Expand Up @@ -2625,7 +2604,6 @@ baz",
"transactionsPerMinute": 11494.736842105262,
},
Object {
"absoluteImpact": 166023502,
"averageResponseTime": 2651.8784461553205,
"impact": 15.770246496477105,
"name": "GET static file",
Expand Down Expand Up @@ -2734,7 +2712,6 @@ baz",
"transactionsPerMinute": 1977031.5789473683,
},
Object {
"absoluteImpact": 10653452,
"averageResponseTime": 1422.926672899693,
"impact": 1.0027124806135428,
"name": "GET unknown route",
Expand Down
20 changes: 5 additions & 15 deletions x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ import { Setup } from '../helpers/setup_request';
interface Bucket {
key: string;
doc_count: number;
avg: {
value: number;
};
p95: {
values: {
'95.0': number;
};
};
durationSum: {
value: number;
};
avg: { value: number };
p95: { values: { '95.0': number } };
sum: { value: number };
sample: {
hits: {
total: number;
Expand Down Expand Up @@ -60,7 +52,7 @@ export function transactionGroupsFetcher(
transactions: {
terms: {
field: `${TRANSACTION_NAME}.keyword`,
order: { durationSum: 'desc' },
order: { sum: 'desc' },
size: 100
},
aggs: {
Expand All @@ -77,9 +69,7 @@ export function transactionGroupsFetcher(
p95: {
percentiles: { field: TRANSACTION_DURATION, percents: [95] }
},
durationSum: {
sum: { field: 'transaction.duration.us' }
}
sum: { sum: { field: TRANSACTION_DURATION } }
}
}
}
Expand Down
Loading

0 comments on commit 9ed6ad0

Please sign in to comment.