mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 16:14:09 +02:00
parent
9a2153d4e0
commit
333ba6ee7e
@ -49,17 +49,10 @@ using namespace icinga;
|
||||
|
||||
LogTable::LogTable(const String& compat_log_path, time_t from, time_t until)
|
||||
{
|
||||
Log(LogInformation, "livestatus", "Pre-selecting log file from " + Convert::ToString(from) + " until " + Convert::ToString(until));
|
||||
|
||||
/* store from & until for FetchRows */
|
||||
/* store attributes for FetchRows */
|
||||
m_TimeFrom = from;
|
||||
m_TimeUntil = until;
|
||||
|
||||
/* create log file index */
|
||||
LogUtility::CreateLogIndex(compat_log_path, m_LogFileIndex);
|
||||
|
||||
/* generate log cache */
|
||||
LogUtility::CreateLogCache(m_LogFileIndex, this, from, until);
|
||||
m_CompatLogPath = compat_log_path;
|
||||
|
||||
AddColumns(this);
|
||||
}
|
||||
@ -104,6 +97,14 @@ String LogTable::GetName(void) const
|
||||
|
||||
void LogTable::FetchRows(const AddRowFunction& addRowFn)
|
||||
{
|
||||
Log(LogInformation, "livestatus", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
|
||||
|
||||
/* create log file index */
|
||||
LogUtility::CreateLogIndex(m_CompatLogPath, m_LogFileIndex);
|
||||
|
||||
/* generate log cache */
|
||||
LogUtility::CreateLogCache(m_LogFileIndex, this, m_TimeFrom, m_TimeUntil);
|
||||
|
||||
unsigned long line_count;
|
||||
|
||||
BOOST_FOREACH(boost::tie(line_count, boost::tuples::ignore), m_RowsCache) {
|
||||
|
@ -74,6 +74,7 @@ private:
|
||||
std::map<time_t, Dictionary::Ptr> m_RowsCache;
|
||||
time_t m_TimeFrom;
|
||||
time_t m_TimeUntil;
|
||||
String m_CompatLogPath;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -50,17 +50,10 @@ using namespace icinga;
|
||||
|
||||
StateHistTable::StateHistTable(const String& compat_log_path, time_t from, time_t until)
|
||||
{
|
||||
Log(LogInformation, "livestatus", "Pre-selecting log file from " + Convert::ToString(from) + " until " + Convert::ToString(until));
|
||||
|
||||
/* store from & until for FetchRows */
|
||||
/* store attributes for FetchRows */
|
||||
m_TimeFrom = from;
|
||||
m_TimeUntil = until;
|
||||
|
||||
/* create log file index */
|
||||
LogUtility::CreateLogIndex(compat_log_path, m_LogFileIndex);
|
||||
|
||||
/* generate log cache */
|
||||
LogUtility::CreateLogCache(m_LogFileIndex, this, from, until);
|
||||
m_CompatLogPath = compat_log_path;
|
||||
|
||||
AddColumns(this);
|
||||
}
|
||||
@ -254,6 +247,14 @@ String StateHistTable::GetName(void) const
|
||||
|
||||
void StateHistTable::FetchRows(const AddRowFunction& addRowFn)
|
||||
{
|
||||
Log(LogInformation, "livestatus", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
|
||||
|
||||
/* create log file index */
|
||||
LogUtility::CreateLogIndex(m_CompatLogPath, m_LogFileIndex);
|
||||
|
||||
/* generate log cache */
|
||||
LogUtility::CreateLogCache(m_LogFileIndex, this, m_TimeFrom, m_TimeUntil);
|
||||
|
||||
Service::Ptr state_hist_service;
|
||||
|
||||
BOOST_FOREACH(boost::tie(state_hist_service, boost::tuples::ignore), m_ServicesCache) {
|
||||
|
@ -84,6 +84,7 @@ private:
|
||||
std::map<Service::Ptr, Array::Ptr> m_ServicesCache;
|
||||
time_t m_TimeFrom;
|
||||
time_t m_TimeUntil;
|
||||
String m_CompatLogPath;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user