The samplebufferfull event of the Profiler interface is fired when the number of samples the profiler has recorded matches the maxBufferSize 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.
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("samplebufferfull", (event) => { })
onsamplebufferfull = (event) => { }
An Event.
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));
});
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Profiler/samplebufferfull_event