Skip to main content

RecentRequest

Struct RecentRequest 

Source
pub struct RecentRequest {
Show 15 fields pub request_id: String, pub at_ms: u64, pub route: String, pub model: Option<String>, pub status: u16, pub prompt_tokens: usize, pub completion_tokens: usize, pub ttft_ms: Option<f64>, pub duration_ms: u64, pub decode_ms: Option<f64>, pub stream: bool, pub acceptance_length: Option<f64>, pub draft_accept_rate_per_position: Option<Vec<f64>>, pub via_api_key: Option<String>, pub client: Option<String>,
}
Expand description

One finished request, as recorded in the ring buffer.

duration_ms and decode_ms are separate on purpose and must stay that way: duration_ms carries queue wait plus prefill plus decode, so dividing completion tokens by it reports a 50 tok/s model as 5 whenever the prompt is long. Everything downstream of that number is then wrong in the same direction.

Fields§

§request_id: String

The same id the response carried, so a UI can join a log line to the message it produced without a claiming heuristic.

§at_ms: u64

Unix epoch milliseconds when the request finished.

§route: String§model: Option<String>

The model that served this request, as /v1/models names it.

Not the model field the client sent. ferrox serves whatever is loaded and ignores that string, so echoing it back would make the log agree with the caller’s belief rather than with what happened – and after a model swap those are different answers. null when nothing was loaded, which is what a 503 row means.

§status: u16§prompt_tokens: usize§completion_tokens: usize§ttft_ms: Option<f64>§duration_ms: u64

Total server-side wall time for the request.

§decode_ms: Option<f64>

Time inside the decode loop only. null when the engine did not time itself, or the answer came from cache.

§stream: bool§acceptance_length: Option<f64>

Completion tokens per verification step when this request used speculative decoding; null when it did not. See crate::Usage::acceptance_length.

§draft_accept_rate_per_position: Option<Vec<f64>>

Accept rate at each position within the draft block. Kept in the ring rather than only in the response body because suffix decay is a property of the drafter over time, and a single request’s numbers are too few to read it off.

§via_api_key: Option<String>

Which bearer key served this request, as a short fingerprint – never the key itself, and never reversible into it.

null means the request carried no Authorization: Bearer header at all, which on a server started without FERROX_API_KEY is every request. Two rows with the same fingerprint were authenticated with the same key; two rows with different fingerprints were not. That is the whole of what this field claims.

The fingerprint is salted per process, so it is stable within one server run and deliberately meaningless across restarts: a captured /admin/stats payload cannot be used offline to test guesses at the key.

§client: Option<String>

The caller’s self-declared label, from the X-Ferrox-Client request header, truncated and stripped of anything that is not a plain label character.

A claim, not proof. Ferrox Studio sends ferrox-studio, and so could any other client; nothing here authenticates it. It is recorded because a self-declared label plus a key fingerprint is still the difference between “an editor is hammering this server” and “that was me in the other tab”, and because inventing the distinction from timing would be worse. A UI that shows it must say it is self-declared.

Trait Implementations§

Source§

impl Clone for RecentRequest

Source§

fn clone(&self) -> RecentRequest

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 Debug for RecentRequest

Source§

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

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

impl<'de> Deserialize<'de> for RecentRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RecentRequest

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for RecentRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RecentRequest

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, 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.