Profiler: samplebufferfull event
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.
Syntax
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("samplebufferfull", (event) => {});
onsamplebufferfull = (event) => {};
Event type
An Event
.
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));
});
Specifications
No specification found
No specification data found for api.Profiler.samplebufferfull_event
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.