MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / drain

Method drain

packages/core/src/tracing/spans/spanBuffer.ts:131–141  ·  view source on GitHub ↗

* Drain and flush all buffered traces.

()

Source from the content-addressed store, hash-verified

129 * Drain and flush all buffered traces.
130 */
131 public drain(): void {
132 if (!this._traceBuckets.size) {
133 return;
134 }
135
136 DEBUG_BUILD && debug.log(`Flushing span tree map with ${this._traceBuckets.size} traces`);
137
138 this._traceBuckets.forEach((_, traceId) => {
139 this.flush(traceId);
140 });
141 }
142
143 /**
144 * Flush spans of a specific trace.

Callers 1

constructorMethod · 0.95

Calls 3

flushMethod · 0.95
logMethod · 0.65
forEachMethod · 0.65

Tested by

no test coverage detected