pub struct CompressTelemetry {
pub codec: &'static str,
pub bytes_in: u64,
pub bytes_out: u64,
pub gpu_seconds: Option<f64>,
pub oom: bool,
}Expand description
v0.8 #55: per-op telemetry returned by CodecRegistry::compress_with_telemetry
/ decompress_with_telemetry. Lets the s4-server caller stamp Prometheus
metrics (s4_gpu_compress_seconds, s4_gpu_throughput_bytes_per_sec,
s4_gpu_oom_total) without s4-codec needing a metrics dep itself —
callback pattern keeps the codec dep tree slim.
Fields:
codec: stable codec kind name (CodecKind::as_str()—"cpu-zstd"/"nvcomp-zstd"/ etc).bytes_in: input length to the operation. For compress this is the uncompressed input; for decompress this is the compressed input.bytes_out: output length. For compress = compressed; for decompress = decompressed.gpu_seconds:Some(elapsed_secs)for GPU-backed codecs (Nvcomp*),Nonefor CPU codecs (CpuZstd / Passthrough / CpuGzip). Callers skip the GPU metric stamp when this isNone.oom:trueiff the operation failed with an OOM-classified error. The associatedResultis stillErr(...); this flag exists so the stamp helper can tell OOM apart from generic backend errors without introspecting theCodecErrorchain at the call site.
Fields§
§codec: &'static str§bytes_in: u64§bytes_out: u64§gpu_seconds: Option<f64>§oom: boolImplementations§
Source§impl CompressTelemetry
impl CompressTelemetry
Sourcepub fn cpu(codec: &'static str, bytes_in: u64, bytes_out: u64) -> Self
pub fn cpu(codec: &'static str, bytes_in: u64, bytes_out: u64) -> Self
CPU-codec convenience constructor — gpu_seconds = None,
oom = false. Used by passthrough / cpu-zstd / cpu-gzip path.
Trait Implementations§
Source§impl Clone for CompressTelemetry
impl Clone for CompressTelemetry
Source§fn clone(&self) -> CompressTelemetry
fn clone(&self) -> CompressTelemetry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressTelemetry
impl Debug for CompressTelemetry
impl Copy for CompressTelemetry
Auto Trait Implementations§
impl Freeze for CompressTelemetry
impl RefUnwindSafe for CompressTelemetry
impl Send for CompressTelemetry
impl Sync for CompressTelemetry
impl Unpin for CompressTelemetry
impl UnsafeUnpin for CompressTelemetry
impl UnwindSafe for CompressTelemetry
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