mirror of https://github.com/Icinga/icinga2.git
parent
7be95a180d
commit
b119c3285b
|
@ -239,8 +239,6 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
|
||||||
|
|
||||||
void CheckerComponent::ResultTimerHandler(void)
|
void CheckerComponent::ResultTimerHandler(void)
|
||||||
{
|
{
|
||||||
Log(LogDebug, "checker", "ResultTimerHandler entered.");
|
|
||||||
|
|
||||||
std::ostringstream msgbuf;
|
std::ostringstream msgbuf;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -249,7 +247,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
||||||
msgbuf << "Pending checkables: " << m_PendingCheckables.size() << "; Idle checkables: " << m_IdleCheckables.size() << "; Checks/s: " << CIB::GetActiveChecksStatistics(5) / 5.0;
|
msgbuf << "Pending checkables: " << m_PendingCheckables.size() << "; Idle checkables: " << m_IdleCheckables.size() << "; Checks/s: " << CIB::GetActiveChecksStatistics(5) / 5.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "checker", msgbuf.str());
|
Log(LogDebug, "checker", msgbuf.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckerComponent::ObjectHandler(const DynamicObject::Ptr& object)
|
void CheckerComponent::ObjectHandler(const DynamicObject::Ptr& object)
|
||||||
|
|
|
@ -747,7 +747,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
|
||||||
*/
|
*/
|
||||||
void StatusDataWriter::StatusTimerHandler(void)
|
void StatusDataWriter::StatusTimerHandler(void)
|
||||||
{
|
{
|
||||||
Log(LogInformation, "compat", "Writing status.dat file");
|
double start = Utility::GetTime();
|
||||||
|
|
||||||
String statuspath = GetStatusPath();
|
String statuspath = GetStatusPath();
|
||||||
String statuspathtmp = statuspath + ".tmp"; /* XXX make this a global definition */
|
String statuspathtmp = statuspath + ".tmp"; /* XXX make this a global definition */
|
||||||
|
@ -818,6 +818,5 @@ void StatusDataWriter::StatusTimerHandler(void)
|
||||||
<< boost::errinfo_file_name(statuspathtmp));
|
<< boost::errinfo_file_name(statuspathtmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "compat", "Finished writing status.dat file");
|
Log(LogInformation, "compat", "Writing status.dat file took " + Utility::FormatDuration(Utility::GetTime() - start));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -378,7 +378,7 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
||||||
m_Process = pi.hProcess;
|
m_Process = pi.hProcess;
|
||||||
m_FD = outReadPipe;
|
m_FD = outReadPipe;
|
||||||
|
|
||||||
Log(LogDebug, "base", "Running command '" + m_Arguments +
|
Log(LogInformation, "base", "Running command '" + m_Arguments +
|
||||||
"': PID " + Convert::ToString(pi.dwProcessId));
|
"': PID " + Convert::ToString(pi.dwProcessId));
|
||||||
|
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
|
@ -476,7 +476,7 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
|
||||||
|
|
||||||
// parent process
|
// parent process
|
||||||
|
|
||||||
Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
Log(LogInformation, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") +
|
||||||
"': PID " + Convert::ToString(m_Process));
|
"': PID " + Convert::ToString(m_Process));
|
||||||
|
|
||||||
m_Arguments.clear();
|
m_Arguments.clear();
|
||||||
|
|
|
@ -323,7 +323,7 @@ void ThreadPool::ManagerThreadProc(void)
|
||||||
<< (long)(total_avg_latency * 1000 / (sizeof(m_Queues) / sizeof(m_Queues[0]))) << "ms"
|
<< (long)(total_avg_latency * 1000 / (sizeof(m_Queues) / sizeof(m_Queues[0]))) << "ms"
|
||||||
<< "; Threads: " << total_alive
|
<< "; Threads: " << total_alive
|
||||||
<< "; Pool utilization: " << (total_utilization / (sizeof(m_Queues) / sizeof(m_Queues[0]))) << "%";
|
<< "; Pool utilization: " << (total_utilization / (sizeof(m_Queues) / sizeof(m_Queues[0]))) << "%";
|
||||||
Log(LogInformation, "base", msgbuf.str());
|
Log(LogDebug, "base", msgbuf.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -743,6 +743,14 @@ String Utility::FormatDuration(int duration)
|
||||||
tokens.push_back(Convert::ToString(seconds) + (seconds != 1 ? " seconds" : " second"));
|
tokens.push_back(Convert::ToString(seconds) + (seconds != 1 ? " seconds" : " second"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tokens.size() == 0) {
|
||||||
|
int milliseconds = floor(duration * 1000);
|
||||||
|
if (milliseconds >= 1)
|
||||||
|
tokens.push_back(Convert::ToString(milliseconds) + (milliseconds != 1 ? " milliseconds" : " millisecond"));
|
||||||
|
else
|
||||||
|
tokens.push_back("less than 1 millisecond");
|
||||||
|
}
|
||||||
|
|
||||||
return NaturalJoin(tokens);
|
return NaturalJoin(tokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ void WorkQueue::StatusTimerHandler(void)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(m_Mutex);
|
boost::mutex::scoped_lock lock(m_Mutex);
|
||||||
|
|
||||||
Log(LogInformation, "base", "WQ #" + Convert::ToString(m_ID) + " items: " + Convert::ToString(m_Items.size()));
|
Log(LogDebug, "base", "WQ #" + Convert::ToString(m_ID) + " items: " + Convert::ToString(m_Items.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkQueue::WorkerThreadProc(void)
|
void WorkQueue::WorkerThreadProc(void)
|
||||||
|
|
Loading…
Reference in New Issue