gossamer/performance_entry
A single entry on the performance timeline — a mark, a measure, or
another runtime-recorded metric. Returned by
performance.entries and the
entries_* queries, and delivered to
performance_observer callbacks.
Every entry carries the four base fields the W3C
PerformanceEntry interface
defines (name, entryType, startTime, duration). The
entryType string surfaces as a typed Kind; the
original JavaScript entry stays accessible via raw for kind-
specific decoding through gleam/dynamic/decode.
Project to a typed
Mark or
Measure via the
submodules’ from_entry helpers.
Types
The kind of entry on the performance timeline. Names match the W3C
Performance Timeline registry; OtherKind(value) carries any
runtime-emitted kind gossamer doesn’t recognize. Runtimes only emit
a subset — see performance_observer.supported_entry_types.
pub type Kind {
MarkKind
MeasureKind
OtherKind(String)
}
Constructors
-
MarkKindUser-recorded mark (
performance.mark). -
MeasureKindUser-recorded measurement (
performance.measure). -
OtherKind(String)Any other entry-type string the runtime exposes that this binding doesn’t recognize.
An entry on the performance timeline. Carries the W3C base fields
plus a typed Kind discriminator and a raw reference
to the original JavaScript entry for kind-specific decoding.
pub type PerformanceEntry {
PerformanceEntry(
name: String,
start_time: duration.Duration,
duration: duration.Duration,
kind: Kind,
raw: dynamic.Dynamic,
)
}
Constructors
-
PerformanceEntry( name: String, start_time: duration.Duration, duration: duration.Duration, kind: Kind, raw: dynamic.Dynamic, )Arguments
- name
-
The entry’s name. For marks and measures, the name the user recorded; for other kinds, an entry-type-specific label.
- start_time
-
When the entry began, relative to
performance.time_origin. - duration
-
The entry’s span length. Zero for marks and other point-in- time kinds.
- kind
-
The kind of entry —
MarkKind/MeasureKind/OtherKindfor everything else. - raw
-
The original JavaScript entry, for manual decoding via
gleam/dynamic/decode.