Markers
Collect performance events from the measure
, performance.mark
and performance.measure
APIs.
Usage
- Browser
- Electron Main
- Electron Renderer
index.js
import { init, markers } from "@palette.dev/browser";
init({
// ...
plugins: [markers()],
});
main.js
import { init, markers } from "@palette.dev/electron/main";
init({
// ...
plugins: [markers()],
});
renderer.js
import { init, markers } from "@palette.dev/electron/renderer";
init({
// ...
plugins: [markers()],
});
Measures
The measure
API allows measuring sub-millisecond latency of events.
measure.start()
and measure.end()
Measure the duration of a task.
Example: Measure the latency of opening a modal
import { measure } from "@palette.dev/browser";
measure.start("modalOpenDuration");
openModal();
measure.end("modalOpenDuration");
Collected Events
performance.mark
entriesperformance.measure
entries