Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 14888ab

Browse files
authored
fix(tracemetrics): Bump metrics buffer to 1k (#18039)
1 parent fe97d67 commit 14888ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎packages/core/src/metrics/internal.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { timestampInSeconds } from '../utils/time';
1212
import { _getTraceInfoFromScope } from '../utils/trace-info';
1313
import { createMetricEnvelope } from './envelope';
1414

15-
const MAX_METRIC_BUFFER_SIZE = 100;
15+
const MAX_METRIC_BUFFER_SIZE = 1000;
1616

1717
/**
1818
* Converts a metric attribute to a serialized metric attribute.

‎packages/core/test/lib/metrics/internal.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ describe('_INTERNAL_captureMetric', () => {
249249
const scope = new Scope();
250250
scope.setClient(client);
251251

252-
// Fill the buffer to max size (100 is the MAX_METRIC_BUFFER_SIZE constant)
253-
for (let i = 0; i < 100; i++) {
252+
// Fill the buffer to max size (1000 is the MAX_METRIC_BUFFER_SIZE constant)
253+
for (let i = 0; i < 1000; i++) {
254254
_INTERNAL_captureMetric({ type: 'counter', name: `metric.${i}`, value: i }, { scope });
255255
}
256256

257-
expect(_INTERNAL_getMetricBuffer(client)).toHaveLength(100);
257+
expect(_INTERNAL_getMetricBuffer(client)).toHaveLength(1000);
258258

259259
// Add one more to trigger flush
260260
_INTERNAL_captureMetric({ type: 'counter', name: 'trigger.flush', value: 999 }, { scope });

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /