Profiler: samplebufferfull-Ereignis

Das samplebufferfull-Ereignis des Profiler-Interfaces wird ausgelöst, wenn die Anzahl der vom Profiler aufgezeichneten Stichproben dem maxBufferSize-Wert entspricht, der an den Konstruktor des Profilers übergeben wurde.

Nachdem dieses Ereignis ausgelöst wurde, nimmt der Profiler keine weiteren Stichproben mehr auf.

Dieses Ereignis kann nicht abgebrochen werden und löst kein Bubbling aus.

Syntax

Verwenden Sie den Ereignisnamen in Methoden wie addEventListener() oder setzen Sie eine Event-Handler-Eigenschaft.

js
addEventListener("samplebufferfull", (event) => { })

onsamplebufferfull = (event) => { }

Ereignistyp

Ein Event.

Beispiele

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));
});

Spezifikationen

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.

Browser-Kompatibilität