56e874ab6d
This commit introduces the full downstream runtime implementation needed to ingest, transform, and publish streams. It preserves the original upstream request boundary by packaging the entire cvmmap-streamer module (build config, public API, protocol and IPC glue, and simulator/tester entrypoints) in one coherent core unit. Keeping this group isolated enables reviewers to validate runtime behavior and correctness without mixing test evidence or process documentation changes. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
41 lines
732 B
C++
41 lines
732 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <deque>
|
|
#include <vector>
|
|
|
|
namespace cvmmap_streamer::metrics {
|
|
|
|
struct LatencySummary {
|
|
std::uint64_t samples{0};
|
|
std::uint64_t min_us{0};
|
|
std::uint64_t max_us{0};
|
|
std::uint64_t avg_us{0};
|
|
std::uint64_t p50_us{0};
|
|
std::uint64_t p95_us{0};
|
|
std::uint64_t p99_us{0};
|
|
};
|
|
|
|
class IngestEmitLatencyTracker {
|
|
public:
|
|
void note_ingest();
|
|
void note_emit();
|
|
void note_emit_stall();
|
|
|
|
[[nodiscard]]
|
|
std::uint64_t emit_stall_events() const;
|
|
|
|
[[nodiscard]]
|
|
std::uint64_t pending_frames() const;
|
|
|
|
[[nodiscard]]
|
|
LatencySummary summarize() const;
|
|
|
|
private:
|
|
std::deque<std::uint64_t> ingest_queue_ns_{};
|
|
std::vector<std::uint64_t> samples_us_{};
|
|
std::uint64_t emit_stall_events_{0};
|
|
};
|
|
|
|
}
|