StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Multimedia::Pipeline::JobTelemetry Class Referencefinal

Retained job telemetry with per-stage snapshots and RSS samples. More...

#include <StormByte/multimedia/pipeline/telemetry.hxx>

Inheritance diagram for StormByte::Multimedia::Pipeline::JobTelemetry:
Collaboration diagram for StormByte::Multimedia::Pipeline::JobTelemetry:

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

Detailed Description

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.

DLL boundary
Owned values use Safe storage and destruction is provider-local. Compatible C++ ABI and the StageTelemetry derived-type lifetime contract are required. Copying and moving are not supported.

Member Typedef Documentation

◆ Stage

Named stage telemetry retained past worker teardown.

Constructor & Destructor Documentation

◆ JobTelemetry()

StormByte::Multimedia::Pipeline::JobTelemetry::JobTelemetry ( )

Construct empty job telemetry.

Exceptions
Safe::AllocationErrorif synchronization storage cannot be allocated.

◆ ~JobTelemetry()

StormByte::Multimedia::Pipeline::JobTelemetry::~JobTelemetry ( )
overridenoexcept

Release job telemetry in its providing library.

Member Function Documentation

◆ MemoryCurrent()

StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryCurrent ( ) const

Current process resident bytes at the last sample.

Returns
Bytes or empty if no sample succeeded.

◆ MemoryMaximum()

StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryMaximum ( ) const

Highest process resident memory sample.

Returns
Bytes or empty if no sample succeeded.

◆ MemoryMinimum()

StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::MemoryMinimum ( ) const

Lowest process resident memory sample.

Returns
Bytes or empty if no sample succeeded.

◆ MemorySamples()

std::uint64_t StormByte::Multimedia::Pipeline::JobTelemetry::MemorySamples ( ) const
noexcept

Number of successful resident-memory samples.

Returns
Sample count.

◆ operator StormByte::Safe::String()

StormByte::Multimedia::Pipeline::JobTelemetry::operator StormByte::Safe::String ( ) const
override

Flatten memory and stage counters into an owned Safe::String.

Returns
Multi-line human-readable snapshot.

◆ PeakMemory()

StormByte::Safe::Optional< std::uint64_t > StormByte::Multimedia::Pipeline::JobTelemetry::PeakMemory ( ) const

Alias for the maximum sampled resident-memory value.

Returns
Sampled peak bytes or empty if no sample succeeded.

◆ RegisterStage()

void StormByte::Multimedia::Pipeline::JobTelemetry::RegisterStage ( StormByte::Safe::String name,
StormByte::Safe::Shared< const StageTelemetry > metrics )

Add a stage handle once.

Parameters
nameDisplay name.
metricsStage counters to retain.

◆ SampleMemory()

void StormByte::Multimedia::Pipeline::JobTelemetry::SampleMemory ( )
noexcept

Sample current process resident memory.

Unsupported platforms or unavailable OS counters add no sample.

◆ Stages()

StormByte::Safe::Vector< Stage > StormByte::Multimedia::Pipeline::JobTelemetry::Stages ( ) const

Snapshot registered stages in registration order.

Returns
Owned list of names and shared metric handles.

◆ Topology()

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.

Returns
Owned topology; Available is false before a run registers it. If a run could not allocate its recorder, RecorderFailed is true and Complete false, so it is never mistaken for a job that has not run yet.
Exceptions
Safe::AllocationErroror std::bad_alloc when owned storage cannot be allocated.

◆ StormByte::Multimedia::Backend::Pipeline::Transcoder

friend class StormByte::Multimedia::Backend::Pipeline::Transcoder
friend

The documentation for this class was generated from the following file: