|
xrpld
|
Measures handler latency on an io_context queue. More...
#include <io_latency_probe.h>

Classes | |
| struct | SampleOp |
Public Member Functions | |
| IOLatencyProbe (duration const &period, boost::asio::io_context &ios) | |
| ~IOLatencyProbe () | |
| template<class Handler> | |
| void | sampleOne (Handler &&handler) |
| Measure one sample of i/o latency. | |
| template<class Handler> | |
| void | sample (Handler &&handler) |
| Initiate continuous i/o latency sampling. | |
| boost::asio::io_context & | getIoContext () |
| Return the io_context associated with the latency probe. | |
| boost::asio::io_context const & | getIoContext () const |
| void | cancel () |
| Cancel all pending i/o. | |
| void | cancelAsync () |
Private Types | |
| using | duration = Clock::duration |
| using | time_point = Clock::time_point |
Private Member Functions | |
| void | cancel (std::unique_lock< decltype(mutex_)> &lock, bool wait) |
| void | addref () |
| void | release () |
Private Attributes | |
| std::recursive_mutex | mutex_ |
| std::condition_variable_any | cond_ |
| std::size_t | count_ {1} |
| duration const | period_ |
| boost::asio::io_context & | ios_ |
| boost::asio::basic_waitable_timer< std::chrono::steady_clock > | timer_ |
| bool | cancel_ {false} |
Measures handler latency on an io_context queue.
Definition at line 18 of file io_latency_probe.h.
|
private |
Definition at line 21 of file io_latency_probe.h.
|
private |
Definition at line 22 of file io_latency_probe.h.
| beast::IOLatencyProbe< Clock >::IOLatencyProbe | ( | duration const & | period, |
| boost::asio::io_context & | ios ) |
Definition at line 33 of file io_latency_probe.h.
| beast::IOLatencyProbe< Clock >::~IOLatencyProbe | ( | ) |
Definition at line 38 of file io_latency_probe.h.
| boost::asio::io_context & beast::IOLatencyProbe< Clock >::getIoContext | ( | ) |
Return the io_context associated with the latency probe.
Definition at line 47 of file io_latency_probe.h.
|
nodiscard |
Definition at line 53 of file io_latency_probe.h.
| void beast::IOLatencyProbe< Clock >::cancel | ( | ) |
Cancel all pending i/o.
Any handlers which have already been queued will still be called.
Definition at line 64 of file io_latency_probe.h.
| void beast::IOLatencyProbe< Clock >::cancelAsync | ( | ) |
Definition at line 71 of file io_latency_probe.h.
| void beast::IOLatencyProbe< Clock >::sampleOne | ( | Handler && | handler | ) |
Measure one sample of i/o latency.
Handler will be called with this signature: void Handler (Duration d);
Definition at line 84 of file io_latency_probe.h.
| void beast::IOLatencyProbe< Clock >::sample | ( | Handler && | handler | ) |
Initiate continuous i/o latency sampling.
Handler will be called with this signature: void Handler (std::chrono::milliseconds);
Definition at line 99 of file io_latency_probe.h.
|
private |
Definition at line 110 of file io_latency_probe.h.
|
private |
Definition at line 123 of file io_latency_probe.h.
|
private |
Definition at line 130 of file io_latency_probe.h.
|
private |
Definition at line 24 of file io_latency_probe.h.
|
private |
Definition at line 25 of file io_latency_probe.h.
|
private |
Definition at line 26 of file io_latency_probe.h.
|
private |
Definition at line 27 of file io_latency_probe.h.
|
private |
Definition at line 28 of file io_latency_probe.h.
|
private |
Definition at line 29 of file io_latency_probe.h.
|
private |
Definition at line 30 of file io_latency_probe.h.