pub struct Trace { /* private fields */ }Expand description
Inference object that provides custom tracing.
Is constructed with TraceHandler object that is activated each time an event occures.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new_with_handle<H: TraceHandler>(
level: Level,
parent_id: u64,
handle: Arc<H>,
) -> Result<Self, Error>
pub fn new_with_handle<H: TraceHandler>( level: Level, parent_id: u64, handle: Arc<H>, ) -> Result<Self, Error>
Create a new inference trace object.
The handler.trace_activity() will be called to report activity for this trace as well as for any child traces that are spawned by this one, and so the trace_activity should check the trace object (first argument) to determine specifically what activity is being reported.
level: The tracing level.
parent_id: The parent trace id for this trace.
A value of 0 indicates that there is not parent trace.
handle: The callback function where activity for the trace is reported.
Sourcepub fn get_id(&self) -> Result<u64, Error>
pub fn get_id(&self) -> Result<u64, Error>
Get the id associated with the trace. Every trace is assigned an id that is unique across all traces created for a Triton server.
Sourcepub fn get_parent_id(&self) -> Result<u64, Error>
pub fn get_parent_id(&self) -> Result<u64, Error>
Get the parent id associated with the trace.
The parent id indicates a parent-child relationship between two traces.
A parent id value of 0 indicates that there is no parent trace.
Sourcepub fn get_model_name(&self) -> Result<&str, Error>
pub fn get_model_name(&self) -> Result<&str, Error>
Get the name of the model associated with the trace.
Sourcepub fn get_model_version(&self) -> Result<i64, Error>
pub fn get_model_version(&self) -> Result<i64, Error>
Get the version of the model associated with the trace.