Profiler: samplebufferfull event
Thesamplebufferfull event of theProfiler interface is fired when the number of samples the profiler has recorded matches themaxBufferSize value passed to the profiler's constructor.
After this event fires, the profiler will not record any more samples.
This event is not cancelable and does not bubble.
In this article
Syntax
Use the event name in methods likeaddEventListener(), or set an event handler property.
js
addEventListener("samplebufferfull", (event) => { })onsamplebufferfull = (event) => { }Event type
AnEvent.
Examples
js
const profiler = new Profiler({ sampleInterval: 10, maxBufferSize: 100 });profiler.addEventListener("samplebufferfull", async () => { console.log("Sample buffer full!"); const trace = await profiler.stop(); console.log(JSON.stringify(trace));});