pub struct TimingUsage {
pub start_time: Instant,
pub end_time: Instant,
pub total_time: Duration,
pub prompt_processing_t: Option<Duration>,
pub generation_t: Option<Duration>,
pub prompt_tok_per_ms: Option<f32>,
pub prompt_tok_per_sec: Option<f32>,
pub generation_tok_per_ms: Option<f32>,
pub generation_tok_per_sec: Option<f32>,
}
Expand description
Timing statistics for the completion request.
Fields§
§start_time: Instant
Timestamp of when the request was created.
end_time: Instant
Timestamp of when the request was completed.
total_time: Duration
Total time taken to process the request.
prompt_processing_t: Option<Duration>
Time taken to process the prompt.
generation_t: Option<Duration>
Time taken to generate the completion.
prompt_tok_per_ms: Option<f32>
Number of prompt tokens processed per millisecond.
prompt_tok_per_sec: Option<f32>
Number of prompt tokens processed per second.
generation_tok_per_ms: Option<f32>
Number of tokens generated per millisecond.
generation_tok_per_sec: Option<f32>
Number of tokens generated per second.
Implementations§
Source§impl TimingUsage
impl TimingUsage
pub fn new_from_llama( res: &LlamaCppCompletionResponse, start_time: Instant, ) -> TimingUsage
pub fn new_from_generic(start_time: Instant) -> TimingUsage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimingUsage
impl RefUnwindSafe for TimingUsage
impl Send for TimingUsage
impl Sync for TimingUsage
impl Unpin for TimingUsage
impl UnwindSafe for TimingUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more