Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/metrics/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { timestampInSeconds } from '../utils/time';
import { _getTraceInfoFromScope } from '../utils/trace-info';
import { createMetricEnvelope } from './envelope';

const MAX_METRIC_BUFFER_SIZE = 100;
const MAX_METRIC_BUFFER_SIZE = 1000;

/**
* Converts a metric attribute to a serialized metric attribute.
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/lib/metrics/internal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ describe('_INTERNAL_captureMetric', () => {
const scope = new Scope();
scope.setClient(client);

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

expect(_INTERNAL_getMetricBuffer(client)).toHaveLength(100);
expect(_INTERNAL_getMetricBuffer(client)).toHaveLength(1000);

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