#[repr(i32)]pub enum ValueDirection {
Unspecified = 0,
BackwardsLooking = 1,
ForwardsLooking = 2,
}Expand description
Direction of the time interval that each emitted sample applies to. A GPU counter is sampled at discrete timestamps, but its value really represents a measurement over some interval around that timestamp (e.g. average GPU utilization over the sampling window). This field tells trace processor on which side of the timestamp that interval lies, which controls where the value is drawn in the UI.
Example: samples at t=10, 20, 30 with values 5, 7, 0. BACKWARDS_LOOKING: 5 covers (-inf, 10], 7 covers (10, 20], 0 covers (20, 30]; the UI draws 7 between t=10 and t=20. FORWARDS_LOOKING: 5 covers [10, 20), 7 covers [20, 30), 0 covers [30, +inf); the UI draws 5 between t=10 and t=20.
Variants§
Unspecified = 0
Treated as BACKWARDS_LOOKING (the historical default).
BackwardsLooking = 1
The value applies to the interval ending at this event’s timestamp. This is the convention used by AGI and most existing GPU producers, where a sample reports what happened during the window leading up to the timestamp.
ForwardsLooking = 2
The value applies to the interval starting at this event’s timestamp, matching standard Perfetto counters. Producers that emit explicit zero samples to denote “no activity from here on” should use this so the zero is not back-propagated over earlier non-zero samples (https://github.com/google/perfetto/issues/5683).
Implementations§
Source§impl ValueDirection
impl ValueDirection
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Trait Implementations§
Source§impl Clone for ValueDirection
impl Clone for ValueDirection
Source§fn clone(&self) -> ValueDirection
fn clone(&self) -> ValueDirection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValueDirection
impl Debug for ValueDirection
Source§impl Default for ValueDirection
impl Default for ValueDirection
Source§fn default() -> ValueDirection
fn default() -> ValueDirection
Source§impl From<ValueDirection> for i32
impl From<ValueDirection> for i32
Source§fn from(value: ValueDirection) -> i32
fn from(value: ValueDirection) -> i32
Source§impl Hash for ValueDirection
impl Hash for ValueDirection
Source§impl Ord for ValueDirection
impl Ord for ValueDirection
Source§fn cmp(&self, other: &ValueDirection) -> Ordering
fn cmp(&self, other: &ValueDirection) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ValueDirection
impl PartialEq for ValueDirection
Source§fn eq(&self, other: &ValueDirection) -> bool
fn eq(&self, other: &ValueDirection) -> bool
self and other values to be equal, and is used by ==.