pub struct RuntimeSchemaMarkerSchema {
pub type_name: String,
pub description: Option<String>,
pub locations: MarkerLocations,
pub chart_label: Option<String>,
pub tooltip_label: Option<String>,
pub table_label: Option<String>,
pub fields: Vec<RuntimeSchemaMarkerField>,
pub graphs: Vec<RuntimeSchemaMarkerGraph>,
}
Expand description
Describes a marker type, including the names and types of the marker’s fields.
You only need this if you don’t know the schema until runtime. Otherwise, use
StaticSchemaMarker
instead.
Example:
use fxprof_processed_profile::{
Profile, Marker, MarkerLocations, MarkerFieldFlags, MarkerFieldFormat, RuntimeSchemaMarkerSchema, RuntimeSchemaMarkerField,
CategoryHandle, StringHandle,
};
let schema = RuntimeSchemaMarkerSchema {
type_name: "custom".into(),
locations: MarkerLocations::MARKER_CHART | MarkerLocations::MARKER_TABLE,
chart_label: Some("{marker.data.eventName}".into()),
tooltip_label: Some("Custom {marker.name} marker".into()),
table_label: Some("{marker.name} - {marker.data.eventName} with allocation size {marker.data.allocationSize} (latency: {marker.data.latency})".into()),
fields: vec![
RuntimeSchemaMarkerField {
key: "eventName".into(),
label: "Event name".into(),
format: MarkerFieldFormat::String,
flags: MarkerFieldFlags::SEARCHABLE,
},
RuntimeSchemaMarkerField {
key: "allocationSize".into(),
label: "Allocation size".into(),
format: MarkerFieldFormat::Bytes,
flags: MarkerFieldFlags::SEARCHABLE,
},
RuntimeSchemaMarkerField {
key: "url".into(),
label: "URL".into(),
format: MarkerFieldFormat::Url,
flags: MarkerFieldFlags::SEARCHABLE,
},
RuntimeSchemaMarkerField {
key: "latency".into(),
label: "Latency".into(),
format: MarkerFieldFormat::Duration,
flags: MarkerFieldFlags::SEARCHABLE,
},
],
description: Some("This is a test marker with a custom schema.".into()),
graphs: vec![],
};
Fields§
§type_name: String
The unique name of this marker type. There must not be any other schema with the same name.
description: Option<String>
An optional description string. Applies to all markers of this type.
locations: MarkerLocations
Set of marker display locations.
chart_label: Option<String>
A template string defining the label shown within each marker’s box in the marker chart.
Usable template literals are {marker.name}
and {marker.data.fieldkey}
.
If set to None
, the boxes in the marker chart will be empty.
tooltip_label: Option<String>
A template string defining the label shown in the first row of the marker’s tooltip.
Usable template literals are {marker.name}
and {marker.data.fieldkey}
.
Defaults to {marker.name}
if set to None
.
table_label: Option<String>
A template string defining the label shown within each marker’s box in the marker chart.
Usable template literals are {marker.name}
and {marker.data.fieldkey}
.
Defaults to {marker.name}
if set to None
.
fields: Vec<RuntimeSchemaMarkerField>
The marker fields. The values are supplied by each marker, in the marker’s
implementations of the string_field_value
and number_field_value
trait methods.
graphs: Vec<RuntimeSchemaMarkerGraph>
Any graph lines / segments created from markers of this type.
If this is non-empty, the Firefox Profiler will create one graph track per marker name, per thread, based on the markers it finds on that thread. The marker name becomes the track’s label.
The elements in the graphs array describe individual graph lines or bar chart segments which are all drawn inside the same track, stacked on top of each other, in the order that they’re listed here, with the first entry becoming the bottom-most graph within the track.
Trait Implementations§
Source§impl Clone for RuntimeSchemaMarkerSchema
impl Clone for RuntimeSchemaMarkerSchema
Source§fn clone(&self) -> RuntimeSchemaMarkerSchema
fn clone(&self) -> RuntimeSchemaMarkerSchema
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more