Profiler: samplebufferfull event

Sự kiện samplebufferfull của giao diện Profiler được kích hoạt khi số lượng mẫu mà profiler đã ghi khớp với giá trị maxBufferSize được truyền vào hàm khởi tạo của profiler.

Sau khi sự kiện này kích hoạt, profiler sẽ không ghi thêm bất kỳ mẫu nào nữa.

Sự kiện này không thể hủy và không nổi bọt.

Cú pháp

Dùng tên sự kiện trong các phương thức như addEventListener(), hoặc đặt thuộc tính trình xử lý sự kiện.

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

onsamplebufferfull = (event) => { }

Loại sự kiện

Một Event.

Ví dụ

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

Thông số kỹ thuật

This feature does not appear to be defined in any specification.

Tương thích trình duyệt