UBERF-4319: Performance changes (#4474)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-01-30 18:07:34 +07:00
committed by GitHub
parent d02e88737d
commit e6a35d2a03
37 changed files with 775 additions and 436 deletions
+8 -2
View File
@@ -80,14 +80,20 @@ export class APMMeasureContext implements MeasureContext {
}
}
async error (err: any): Promise<void> {
async error (message: string, ...args: any[]): Promise<void> {
this.logger.error(message, args)
await new Promise<void>((resolve) => {
this.agent.captureError(err, () => {
this.agent.captureError({ message, params: args }, () => {
resolve()
})
})
}
async info (message: string, ...args: any[]): Promise<void> {
this.logger.info(message, args)
}
end (): void {
this.transaction?.end()
}
+1
View File
@@ -4,6 +4,7 @@ import { writeFile } from 'fs/promises'
const apmUrl = process.env.APM_SERVER_URL
const metricsFile = process.env.METRICS_FILE
// const logsRoot = process.env.LOGS_ROOT
const metricsConsole = (process.env.METRICS_CONSOLE ?? 'false') === 'true'
const METRICS_UPDATE_INTERVAL = !metricsConsole ? 1000 : 60000