#include <userver/utils/statistics/busy.hpp>
Measure how much time we've spent in work recently in percents that supports recirsive starts. Use utils::statistics::BusyMarker for RAII time measures.
Public Types | |
using | Duration = std::chrono::steady_clock::duration |
Public Member Functions | |
BusyStorage (Duration epoch_duration, Duration history_period) | |
double | GetCurrentLoad () const |
Safe to read concurrently with calling StartWork() and StopWork() | |
void | StartWork () |
Starts the time measure, if it was not already started. | |
void | StopWork () noexcept |
bool | IsAlreadyStarted () const noexcept |
Returns true if the time measure is active. | |
using utils::statistics::BusyStorage::Duration = std::chrono::steady_clock::duration |
|
noexcept |
Stops the time measure if the count of StopWork() invocations matches the StartWork() invocations count.