pub struct ServerTelemetry {
pub time_s: Option<f64>,
pub usage: Option<ServerUsage>,
}Expand description
Server telemetry for one response: Qdrant’s time (seconds, float) plus
the hardware/inference usage object. Both halves are optional — routes
and transports that do not report them (batch items, collection DDL over
gRPC, mocks) yield None.
Fields§
§time_s: Option<f64>Seconds the server spent processing the request, when reported.
usage: Option<ServerUsage>Hardware/inference usage, when reported.
Implementations§
Source§impl ServerTelemetry
impl ServerTelemetry
Sourcepub fn from_envelope(value: &Value) -> Self
pub fn from_envelope(value: &Value) -> Self
Extract from a backend response envelope. Lenient by contract: absent
or misshapen time/usage becomes None, never an error.
Telemetry only — the response data path stays strict
(rest_response::parse_* fail QQL-BACKEND-ENVELOPE).
Sourcepub fn from_envelope_opt(value: &Value) -> Option<Self>
pub fn from_envelope_opt(value: &Value) -> Option<Self>
None when the envelope carried neither half (keeps
ExecResponse.telemetry exactly None where the backend sent
nothing); Some otherwise, even if only one half is present.
Telemetry only, never a data-path fallback.
Sourcepub fn aggregate<'a>(
items: impl Iterator<Item = &'a ServerTelemetry>,
) -> Option<ServerTelemetry>
pub fn aggregate<'a>( items: impl Iterator<Item = &'a ServerTelemetry>, ) -> Option<ServerTelemetry>
Aggregate per-response telemetry into report-level totals: server
times summed (absent when no response reported one), usage merged.
None when there is nothing to aggregate.