mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-26 02:58:43 +02:00
IcingaCheckTask: Add available I/O cpu semaphores as a perfdata
This commit is contained in:
parent
4b884ea953
commit
a323bb3c1c
@ -85,6 +85,11 @@ boost::asio::io_context& IoEngine::GetIoContext()
|
||||
return m_IoContext;
|
||||
}
|
||||
|
||||
int_fast32_t IoEngine::GetCpuSemaphore() const
|
||||
{
|
||||
return m_CpuBoundSemaphore;
|
||||
}
|
||||
|
||||
IoEngine::IoEngine() : m_IoContext(), m_KeepAlive(boost::asio::make_work_guard(m_IoContext)), m_Threads(decltype(m_Threads)::size_type(Configuration::Concurrency * 2u)), m_AlreadyExpiredTimer(m_IoContext)
|
||||
{
|
||||
m_AlreadyExpiredTimer.expires_at(boost::posix_time::neg_infin);
|
||||
|
@ -83,6 +83,8 @@ public:
|
||||
|
||||
boost::asio::io_context& GetIoContext();
|
||||
|
||||
int_fast32_t GetCpuSemaphore() const;
|
||||
|
||||
static inline size_t GetCoroutineStackSize() {
|
||||
#ifdef _WIN32
|
||||
// Increase the stack size for Windows coroutines to prevent exception corruption.
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "icinga/checkable.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/io-engine.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/function.hpp"
|
||||
@ -81,6 +81,8 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
|
||||
perfdata->Add(new PerfdataValue("current_concurrent_checks", Checkable::CurrentConcurrentChecks.load()));
|
||||
perfdata->Add(new PerfdataValue("remote_check_queue", ClusterEvents::GetCheckRequestQueueSize()));
|
||||
|
||||
perfdata->Add(new PerfdataValue("num_free_io_cpu_slots", IoEngine::Get().GetCpuSemaphore()));
|
||||
|
||||
CheckableCheckStatistics scs = CIB::CalculateServiceCheckStats();
|
||||
|
||||
perfdata->Add(new PerfdataValue("min_latency", scs.min_latency));
|
||||
|
Loading…
x
Reference in New Issue
Block a user