Skip to content

Commit

Permalink
Enable metric buffering (#586)
Browse files Browse the repository at this point in the history
Set buffer size to 8192 (8KB)
  • Loading branch information
nhulston authored Oct 29, 2024
1 parent 79c6a8a commit c7a87e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/metrics/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export class MetricsListener {
logDebug(`Using StatsD client`);

this.globalTags = this.getGlobalTags(context);
this.statsDClient = new StatsD({ host: "127.0.0.1", closingFlushInterval: 1 });
// About 200 chars per metric, so 8KB buffer size holds approx 40 metrics per request
this.statsDClient = new StatsD({ host: "127.0.0.1", closingFlushInterval: 1, maxBufferSize: 8192 });
return;
}
if (this.config.logForwarding) {
Expand Down

0 comments on commit c7a87e9

Please sign in to comment.