rippled
|
Measures handler latency on an io_service queue. More...
Classes | |
struct | sample_op |
Public Member Functions | |
io_latency_probe (duration const &period, boost::asio::io_service &ios) | |
~io_latency_probe () | |
template<class Handler > | |
void | sample_one (Handler &&handler) |
Measure one sample of i/o latency. More... | |
template<class Handler > | |
void | sample (Handler &&handler) |
Initiate continuous i/o latency sampling. More... | |
boost::asio::io_service & | get_io_service () |
Return the io_service associated with the latency probe. More... | |
boost::asio::io_service const & | get_io_service () const |
void | cancel () |
Cancel all pending i/o. More... | |
void | cancel_async () |
Private Types | |
using | duration = typename Clock::duration |
using | time_point = typename Clock::time_point |
Private Member Functions | |
void | cancel (std::unique_lock< decltype(m_mutex)> &lock, bool wait) |
void | addref () |
void | release () |
Private Attributes | |
std::recursive_mutex | m_mutex |
std::condition_variable_any | m_cond |
std::size_t | m_count |
const duration | m_period |
boost::asio::io_service & | m_ios |
boost::asio::basic_waitable_timer< std::chrono::steady_clock > | m_timer |
bool | m_cancel |
Measures handler latency on an io_service queue.
Definition at line 34 of file io_latency_probe.h.
|
private |
Definition at line 37 of file io_latency_probe.h.
|
private |
Definition at line 38 of file io_latency_probe.h.
beast::io_latency_probe< Clock >::io_latency_probe | ( | duration const & | period, |
boost::asio::io_service & | ios | ||
) |
Definition at line 49 of file io_latency_probe.h.
beast::io_latency_probe< Clock >::~io_latency_probe | ( | ) |
Definition at line 58 of file io_latency_probe.h.
boost::asio::io_service& beast::io_latency_probe< Clock >::get_io_service | ( | ) |
Return the io_service associated with the latency probe.
Definition at line 67 of file io_latency_probe.h.
boost::asio::io_service const& beast::io_latency_probe< Clock >::get_io_service | ( | ) | const |
Definition at line 73 of file io_latency_probe.h.
void beast::io_latency_probe< Clock >::cancel | ( | ) |
Cancel all pending i/o.
Any handlers which have already been queued will still be called.
Definition at line 84 of file io_latency_probe.h.
void beast::io_latency_probe< Clock >::cancel_async | ( | ) |
Definition at line 91 of file io_latency_probe.h.
void beast::io_latency_probe< Clock >::sample_one | ( | Handler && | handler | ) |
Measure one sample of i/o latency.
Handler will be called with this signature: void Handler (Duration d);
Definition at line 104 of file io_latency_probe.h.
void beast::io_latency_probe< 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 119 of file io_latency_probe.h.
|
private |
Definition at line 130 of file io_latency_probe.h.
|
private |
Definition at line 143 of file io_latency_probe.h.
|
private |
Definition at line 150 of file io_latency_probe.h.
|
private |
Definition at line 40 of file io_latency_probe.h.
|
private |
Definition at line 41 of file io_latency_probe.h.
|
private |
Definition at line 42 of file io_latency_probe.h.
|
private |
Definition at line 43 of file io_latency_probe.h.
|
private |
Definition at line 44 of file io_latency_probe.h.
|
private |
Definition at line 45 of file io_latency_probe.h.
|
private |
Definition at line 46 of file io_latency_probe.h.