Retained job telemetry with per-stage snapshots and RSS samples. More...
#include <StormByte/multimedia/pipeline/telemetry.hxx>


Public Types | |
| using | Stage = TelemetryStage |
| Named stage telemetry retained past worker teardown. | |
Public Member Functions | |
| JobTelemetry () | |
| Construct empty job telemetry. | |
| ~JobTelemetry () noexcept override | |
| Release job telemetry in its providing library. | |
| void | RegisterStage (StormByte::Safe::String name, StormByte::Safe::Shared< const StageTelemetry > metrics) |
| Add a stage handle once. | |
| StormByte::Safe::Vector< Stage > | Stages () const |
| Snapshot registered stages in registration order. | |
| TopologySnapshot | Topology () const |
| Snapshot the real stages, queues and shared budgets of the job. | |
| void | SampleMemory () noexcept |
| Sample current process resident memory. | |
| StormByte::Safe::Optional< std::uint64_t > | MemoryCurrent () const |
| Current process resident bytes at the last sample. | |
| StormByte::Safe::Optional< std::uint64_t > | MemoryMinimum () const |
| Lowest process resident memory sample. | |
| StormByte::Safe::Optional< std::uint64_t > | MemoryMaximum () const |
| Highest process resident memory sample. | |
| StormByte::Safe::Optional< std::uint64_t > | PeakMemory () const |
| Alias for the maximum sampled resident-memory value. | |
| std::uint64_t | MemorySamples () const noexcept |
| Number of successful resident-memory samples. | |
| operator StormByte::Safe::String () const override | |
| Flatten memory and stage counters into an owned Safe::String. | |
| Public Member Functions inherited from StormByte::Telemetry | |
| virtual | ~Telemetry () noexcept |
| virtual | operator Safe::String () const=0 |
| STORMBYTE_FORCE_INLINE | operator std::string () const |
Friends | |
| class | StormByte::Multimedia::Backend::Pipeline::Transcoder |
Additional Inherited Members | |
| Protected Member Functions inherited from StormByte::Telemetry | |
| Telemetry () noexcept | |
| Telemetry (const Telemetry &)=delete | |
| Telemetry (Telemetry &&other) noexcept | |
| Telemetry & | operator= (const Telemetry &)=delete |
| Telemetry & | operator= (Telemetry &&other) noexcept |
| class Clock & | Clock (std::string_view name) |
| class Clock::Sample | MeasureClock (std::string_view name) noexcept |
| const class Clock & | Clock (std::string_view name) const |
Retained job telemetry with per-stage snapshots and RSS samples.
Resident memory is sampled process-wide. Minimum and maximum are the lowest and highest successful samples during this job; PeakMemory is the sampled maximum, not an allocator-exact or OS-lifetime peak. Sampling is nominally every 20 ms while the job is running. It is not attributed to individual stages. Stage registration and owned snapshots, including engaged memory optionals, may allocate and propagate allocation failures.
Topology exposes the stages and Buffer queues of the latest run, live while it runs and final after teardown.
Named stage telemetry retained past worker teardown.
| StormByte::Multimedia::Pipeline::JobTelemetry::JobTelemetry | ( | ) |
Construct empty job telemetry.
| Safe::AllocationError | if synchronization storage cannot be allocated. |
|
overridenoexcept |
Release job telemetry in its providing library.
| StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryCurrent | ( | ) | const |
Current process resident bytes at the last sample.
| StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryMaximum | ( | ) | const |
Highest process resident memory sample.
| StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryMinimum | ( | ) | const |
Lowest process resident memory sample.
|
noexcept |
Number of successful resident-memory samples.
|
override |
Flatten memory and stage counters into an owned Safe::String.
| StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::PeakMemory | ( | ) | const |
Alias for the maximum sampled resident-memory value.
| void StormByte::Multimedia::Pipeline::JobTelemetry::RegisterStage | ( | StormByte::Safe::String | name, |
| StormByte::Safe::Shared< const StageTelemetry > | metrics ) |
|
noexcept |
Sample current process resident memory.
Unsupported platforms or unavailable OS counters add no sample.
| StormByte::Safe::Vector< Stage > StormByte::Multimedia::Pipeline::JobTelemetry::Stages | ( | ) | const |
Snapshot registered stages in registration order.
| TopologySnapshot StormByte::Multimedia::Pipeline::JobTelemetry::Topology | ( | ) | const |
Snapshot the real stages, queues and shared budgets of the job.
Thread-safe and usable while the job runs, is paused, after cancellation or failure, and after the Transcoder was destroyed (the returned handle of Transcoder::Telemetry() is enough). The snapshot owns no stage and no queue: live readings go through provider-owned probes that freeze to final values when their stage is destroyed. After teardown the topology becomes TopologySnapshotState::Final if the final copy succeeds, otherwise TopologySnapshotState::Unfrozen.
| Safe::AllocationError | or std::bad_alloc when owned storage cannot be allocated. |
|
friend |