mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -21,13 +21,35 @@
|
||||
|
||||
namespace rpc {
|
||||
|
||||
WorkQueue::WorkQueue(std::uint32_t numWorkers, uint32_t maxSize) : ioc_{numWorkers}
|
||||
WorkQueue::WorkQueue(std::uint32_t numWorkers, uint32_t maxSize)
|
||||
: queued_{PrometheusService::counterInt(
|
||||
"work_queue_queued_total_number",
|
||||
util::prometheus::Labels(),
|
||||
"The total number of tasks queued for processing"
|
||||
)}
|
||||
, durationUs_{PrometheusService::counterInt(
|
||||
"work_queue_cumulitive_tasks_duration_us",
|
||||
util::prometheus::Labels(),
|
||||
"The total number of microseconds tasks were waiting to be executed"
|
||||
)}
|
||||
, curSize_{PrometheusService::gaugeInt(
|
||||
"work_queue_current_size",
|
||||
util::prometheus::Labels(),
|
||||
"The current number of tasks in the queue"
|
||||
)}
|
||||
, ioc_{numWorkers}
|
||||
{
|
||||
if (maxSize != 0)
|
||||
maxSize_ = maxSize;
|
||||
}
|
||||
|
||||
WorkQueue::~WorkQueue()
|
||||
{
|
||||
join();
|
||||
}
|
||||
|
||||
void
|
||||
WorkQueue::join()
|
||||
{
|
||||
ioc_.join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user