From 96dc110f4a353871ac74c82ff4b1bcc4c34156f3 Mon Sep 17 00:00:00 2001 From: Giacomo Pozzoni Date: Sat, 24 Jul 2021 14:50:30 +0200 Subject: Core/DBLayer: Add QueueSize() method (#26733) * Core/DBLayer: Add QueueSize() method Add QueueSize() method to database objects (Login, Character and World) that returns how many tasks are queued. Include the queue size of the 3 databases in ".server debug" command * Make the code less threadsafe * Send data to InfluxDB * Update grafana dashboard --- src/common/Threading/ProducerConsumerQueue.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/common/Threading') diff --git a/src/common/Threading/ProducerConsumerQueue.h b/src/common/Threading/ProducerConsumerQueue.h index 1341bd26747..778f434e9de 100644 --- a/src/common/Threading/ProducerConsumerQueue.h +++ b/src/common/Threading/ProducerConsumerQueue.h @@ -52,6 +52,11 @@ public: return _queue.empty(); } + size_t Size() const + { + return _queue.size(); + } + bool Pop(T& value) { std::lock_guard lock(_queueLock); -- cgit v1.2.3