#include <userver/utils/statistics/busy.hpp>
A RAII-style guard to account code block execution time in utils::statistics::BusyStorage. Aware of recursive invocations in the same thread.
EXPECT_FLOAT_EQ(0, storage.GetCurrentLoad());
{
if (some_heavy_task_that_takes_1s()) {
some_heavy_task_that_takes_3s();
EXPECT_FLOAT_EQ(0.8, storage.GetCurrentLoad());
}
}
EXPECT_LE(0.2, storage.GetCurrentLoad());
sleep_for_more_than_5s();
EXPECT_FLOAT_EQ(0, storage.GetCurrentLoad());
Definition at line 52 of file busy.hpp.
◆ BusyMarker()
utils::statistics::BusyMarker::BusyMarker |
( |
BusyStorage & | storage | ) |
|
|
inline |
◆ ~BusyMarker()
utils::statistics::BusyMarker::~BusyMarker |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: