Skip to content

Commit 42b87c0

Browse files
authored
[APM] Script for metric aggregation (#67964)
* [APM] Script for metric aggregation * Retry mechanism * Docs/comments * compress histogram; support --filter & --only parameters * Add flag for significant figures * Ignore apm scripts * Add tsconfig project for apm/scripts
1 parent 1ae5d32 commit 42b87c0

File tree

12 files changed

+704
-115
lines changed

12 files changed

+704
-115
lines changed

src/dev/typescript/projects.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export const PROJECTS = [
3434
name: 'apm/cypress',
3535
disableTypeCheck: true,
3636
}),
37+
new Project(resolve(REPO_ROOT, 'x-pack/plugins/apm/scripts/tsconfig.json'), {
38+
name: 'apm/scripts',
39+
disableTypeCheck: true,
40+
}),
3741

3842
// NOTE: using glob.sync rather than glob-all or globby
3943
// because it takes less than 10 ms, while the other modules
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
// eslint-disable-next-line import/no-extraneous-dependencies
7+
require('@babel/register')({
8+
extensions: ['.ts'],
9+
plugins: [
10+
'@babel/plugin-proposal-optional-chaining',
11+
'@babel/plugin-proposal-nullish-coalescing-operator',
12+
],
13+
presets: [
14+
'@babel/typescript',
15+
['@babel/preset-env', { targets: { node: 'current' } }],
16+
],
17+
});
18+
19+
const {
20+
aggregateLatencyMetrics,
21+
} = require('./aggregate-latency-metrics/index.ts');
22+
23+
aggregateLatencyMetrics().catch((err) => {
24+
if (err.meta && err.meta.body) {
25+
// error from elasticsearch client
26+
console.error(err.meta.body);
27+
} else {
28+
console.error(err);
29+
}
30+
process.exit(1);
31+
});

0 commit comments

Comments
 (0)