Skip to content

Commit c7a87e9

Browse files
authored
Enable metric buffering (#586)
Set buffer size to 8192 (8KB)
1 parent 79c6a8a commit c7a87e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/metrics/listener.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export class MetricsListener {
7878
logDebug(`Using StatsD client`);
7979

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

0 commit comments

Comments
 (0)