83 std::chrono::microseconds
Time{};
147 return std::chrono::microseconds{StopCount()};
163 std::int64_t StopCount() noexcept;
165 Safe::Shared<State> m_state;
166 std::chrono::steady_clock::time_point m_start{};
167 std::chrono::microseconds m_elapsed{};
168 bool m_active{
false};
214 const Counts raw = ReadCounts();
217 std::chrono::microseconds{raw.time},
218 std::chrono::microseconds{raw.mean}
226 std::uint64_t
Count() const noexcept;
249 std::uint64_t count{};
258 Counts ReadCounts() const noexcept;
260 mutable std::mutex m_state_lock;
261 Safe::Shared<State> m_state;
291 return static_cast<std::string
>(
static_cast<Safe::String>(*this));
351 Safe::Unique<Store> m_store;
One independently timed interval contributing to a shared Clock.
Definition telemetry.hxx:97
Sample() noexcept=default
Construct an empty, inactive sample token.
friend class Clock
Definition telemetry.hxx:151
STORMBYTE_FORCE_INLINE std::chrono::microseconds Stop() noexcept
Complete and record this sample once.
Definition telemetry.hxx:146
bool Active() const noexcept
Whether this token owns a measurement that will be recorded.
Thread-safe aggregate of independently timed operation samples.
Definition telemetry.hxx:68
Clock() noexcept
Construct zeroed shared clock state.
std::uint64_t Count() const noexcept
Number of completed samples.
STORMBYTE_FORCE_INLINE Values GetValues() const noexcept
Read Count, Time and MeanDuration under one lock.
Definition telemetry.hxx:213
STORMBYTE_FORCE_INLINE std::chrono::microseconds Time() const noexcept
Cumulative duration of completed samples.
Definition telemetry.hxx:232
STORMBYTE_FORCE_INLINE std::chrono::microseconds MeanDuration() const noexcept
Mean duration across completed samples.
Definition telemetry.hxx:240
Sample Measure()
Start an independent interval sample.
Forward declaration of shared ownership.
Definition pointers.hxx:133
Owned UTF-8 text.
Definition string.hxx:113
virtual operator Safe::String() const =0
Flatten counters into an owned StormByte Safe::String.
class Clock::Sample MeasureClock(std::string_view name) noexcept
Start an independent sample on a named aggregate clock.
Telemetry() noexcept
Construct an empty telemetry drawer.
class Clock & Clock(std::string_view name)
Access or create a named clock in the drawer.
virtual ~Telemetry() noexcept
Virtual destructor.
Owned values that cross a DLL without the caller's CRT.
Root namespace of the StormByte suite.
Octet count. Defined in byte_size.hxx. Forwarded so Type::Numeral can name it.
Coherent snapshot of completed measurements.
Definition telemetry.hxx:81
std::chrono::microseconds Time
Sum of completed sample durations.
Definition telemetry.hxx:83
std::uint64_t Count
Number of completed samples.
Definition telemetry.hxx:82
std::chrono::microseconds MeanDuration
Mean duration, or zero when empty.
Definition telemetry.hxx:84
Recognizes types whose DLL-boundary safety depends on documented provider requirements.
Definition safe.hxx:262
Recognizes Base Safe components, not universal ABI compatibility.
Definition safe.hxx:138
#define STORMBYTE_PUBLIC
Definition visibility.h:52