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

(cherry picked from commit 96dc110f4a)
This commit is contained in:
Giacomo Pozzoni
2021-07-24 14:50:30 +02:00
committed by Shauren
parent 21177487ea
commit 51f0294c18
6 changed files with 268 additions and 22 deletions

View File

@@ -414,6 +414,12 @@ void DatabaseWorkerPool<T>::Enqueue(SQLOperation* op)
_queue->Push(op);
}
template <class T>
size_t DatabaseWorkerPool<T>::QueueSize() const
{
return _queue->Size();
}
template <class T>
T* DatabaseWorkerPool<T>::GetFreeConnection()
{

View File

@@ -213,6 +213,8 @@ class DatabaseWorkerPool
#endif
}
size_t QueueSize() const;
private:
uint32 OpenConnections(InternalIndex type, uint8 numConnections);