Struct RuntimeSchemaMarkerSchema

Source
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

Source§

fn clone(&self) -> RuntimeSchemaMarkerSchema

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeSchemaMarkerSchema

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.