mirror of https://github.com/Icinga/icinga2.git
parent
bb83c32c0c
commit
cd20044e4f
|
@ -166,7 +166,7 @@ void WorkQueue::ReportExceptions(const String& facility) const
|
|||
<< exceptions.size() << " error" << (exceptions.size() != 1 ? "s" : "");
|
||||
}
|
||||
|
||||
size_t WorkQueue::GetLength(void)
|
||||
size_t WorkQueue::GetLength(void) const
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_Mutex);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
bool IsWorkerThread(void) const;
|
||||
|
||||
size_t GetLength(void);
|
||||
size_t GetLength(void) const;
|
||||
|
||||
void SetExceptionCallback(const ExceptionCallback& callback);
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
bool GetStatusUpdate(const DbObject::Ptr& dbobj) const;
|
||||
|
||||
int GetQueryCount(RingBuffer::SizeType span) const;
|
||||
virtual int GetPendingQueryCount(void) const = 0;
|
||||
|
||||
static void ValidateFailoverTimeout(const String& location, const DbConnection::Ptr& object);
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
|
|||
perfdata->Add(new PerfdataValue("queries_1min", conn->GetQueryCount(60)));
|
||||
perfdata->Add(new PerfdataValue("queries_5mins", conn->GetQueryCount(5 * 60)));
|
||||
perfdata->Add(new PerfdataValue("queries_15mins", conn->GetQueryCount(15 * 60)));
|
||||
perfdata->Add(new PerfdataValue("pending_queries", conn->GetPendingQueryCount()));
|
||||
cr->SetPerformanceData(perfdata);
|
||||
|
||||
checkable->ProcessCheckResult(cr);
|
||||
|
|
|
@ -770,3 +770,8 @@ void IdoMysqlConnection::FillIDCache(const DbType::Ptr& type)
|
|||
SetInsertID(type, DbReference(row->Get("object_id")), DbReference(row->Get(type->GetTable() + "_id")));
|
||||
}
|
||||
}
|
||||
|
||||
int IdoMysqlConnection::GetPendingQueryCount(void) const
|
||||
{
|
||||
return m_QueryQueue.GetLength();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ public:
|
|||
|
||||
static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
virtual int GetPendingQueryCount(void) const;
|
||||
|
||||
protected:
|
||||
virtual void Resume(void);
|
||||
virtual void Pause(void);
|
||||
|
|
|
@ -781,3 +781,8 @@ void IdoPgsqlConnection::FillIDCache(const DbType::Ptr& type)
|
|||
SetInsertID(type, DbReference(row->Get("object_id")), DbReference(row->Get(type->GetTable() + "_id")));
|
||||
}
|
||||
}
|
||||
|
||||
int IdoPgsqlConnection::GetPendingQueryCount(void) const
|
||||
{
|
||||
return m_QueryQueue.GetLength();
|
||||
}
|
||||
|
|
|
@ -42,10 +42,12 @@ public:
|
|||
DECLARE_OBJECT(IdoPgsqlConnection);
|
||||
DECLARE_OBJECTNAME(IdoPgsqlConnection);
|
||||
|
||||
IdoPgsqlConnection(void);
|
||||
IdoPgsqlConnection(void);
|
||||
|
||||
static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
virtual int GetPendingQueryCount(void) const;
|
||||
|
||||
protected:
|
||||
virtual void Resume(void);
|
||||
virtual void Pause(void);
|
||||
|
|
Loading…
Reference in New Issue