Skip to main content

RenderStatistics

Struct RenderStatistics 

Source
pub struct RenderStatistics {
    pub frames: u64,
    pub frame_thread: usize,
    pub frame_kind: i32,
    pub frame_gl_major_version: i32,
    pub frame_width: i32,
    pub frame_height: i32,
    pub ticks: u64,
    pub tick_proxied_calls: Option<u64>,
    pub last_proxied_function: i64,
    pub canvases_released: u64,
    pub render_thread_panics: u64,
}
Expand description

What the page can read about the frames that reached its canvases: how many, which thread drew the last one and to what, and what the ticks of a render thread cost the thread of the page.

Not from upstream. With a render worker nothing on the thread of the page sees a frame, so a page (a test, a diagnostic overlay of the host) that wants to know where rendering happens reads it here. The numbers are counted for all canvases of the module.

The fields are read one after the other from counters that the thread that renders goes on writing: two of them may belong to different frames.

Fields§

§frames: u64

The frames that were drawn to a canvas since the module started.

§frame_thread: usize

The thread that drew the last frame, as current_thread names it there; 0 before the first frame, and always in a build without threads.

§frame_kind: i32

The kind of the render target of the last frame: RENDER_TARGET_KIND_WEB_GL or RENDER_TARGET_KIND_SOFTWARE; 0 before the first frame.

§frame_gl_major_version: i32

The major version of OpenGL ES the last frame was drawn with (2 for WebGL 1, 3 for WebGL 2); 0 for a frame drawn in memory.

§frame_width: i32

The width of the last frame in device pixels.

§frame_height: i32

The height of the last frame in device pixels.

§ticks: u64

The ticks of the frame loop of a render thread since the module started. A tick renders a frame only when something changed. Ticks of the frame loop of the page are not counted.

§tick_proxied_calls: Option<u64>

The calls the runtime carried from the render thread to the main thread of the page during those ticks (a call of the C library that only the main thread can serve: a line on the console, a file); None when the script of the thread does not count them. While such a call is served the render thread waits for the thread of the page.

§last_proxied_function: i64

The index, in the table of the script of the module, of the function of the last such call; -1 when there was none.

§canvases_released: u64

The canvases of closed views whose render target the thread that drew to them has released (RenderTargetBrowserSurface::dispose).

§render_thread_panics: u64

The panics of the render thread since the module started. A frame that panics is caught by the render loop, which goes on with the next tick; each is reported to the thread of the page (RenderWorker).

Implementations§

Source§

impl RenderStatistics

Source

pub fn current() -> Self

The statistics as they are now. Any thread may ask.

Trait Implementations§

Source§

impl Clone for RenderStatistics

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for RenderStatistics

Source§

impl Debug for RenderStatistics

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RenderStatistics

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RenderStatistics

Source§

impl PartialEq for RenderStatistics

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderStatistics

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> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PropertyValue for T
where T: Clone + PartialEq + 'static,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more