mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 00:24:23 +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)
|
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 attributes for FetchRows */
|
||||||
|
|
||||||
/* store from & until for FetchRows */
|
|
||||||
m_TimeFrom = from;
|
m_TimeFrom = from;
|
||||||
m_TimeUntil = until;
|
m_TimeUntil = until;
|
||||||
|
m_CompatLogPath = compat_log_path;
|
||||||
/* create log file index */
|
|
||||||
LogUtility::CreateLogIndex(compat_log_path, m_LogFileIndex);
|
|
||||||
|
|
||||||
/* generate log cache */
|
|
||||||
LogUtility::CreateLogCache(m_LogFileIndex, this, from, until);
|
|
||||||
|
|
||||||
AddColumns(this);
|
AddColumns(this);
|
||||||
}
|
}
|
||||||
@ -104,6 +97,14 @@ String LogTable::GetName(void) const
|
|||||||
|
|
||||||
void LogTable::FetchRows(const AddRowFunction& addRowFn)
|
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;
|
unsigned long line_count;
|
||||||
|
|
||||||
BOOST_FOREACH(boost::tie(line_count, boost::tuples::ignore), m_RowsCache) {
|
BOOST_FOREACH(boost::tie(line_count, boost::tuples::ignore), m_RowsCache) {
|
||||||
|
@ -74,6 +74,7 @@ private:
|
|||||||
std::map<time_t, Dictionary::Ptr> m_RowsCache;
|
std::map<time_t, Dictionary::Ptr> m_RowsCache;
|
||||||
time_t m_TimeFrom;
|
time_t m_TimeFrom;
|
||||||
time_t m_TimeUntil;
|
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)
|
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 attributes for FetchRows */
|
||||||
|
|
||||||
/* store from & until for FetchRows */
|
|
||||||
m_TimeFrom = from;
|
m_TimeFrom = from;
|
||||||
m_TimeUntil = until;
|
m_TimeUntil = until;
|
||||||
|
m_CompatLogPath = compat_log_path;
|
||||||
/* create log file index */
|
|
||||||
LogUtility::CreateLogIndex(compat_log_path, m_LogFileIndex);
|
|
||||||
|
|
||||||
/* generate log cache */
|
|
||||||
LogUtility::CreateLogCache(m_LogFileIndex, this, from, until);
|
|
||||||
|
|
||||||
AddColumns(this);
|
AddColumns(this);
|
||||||
}
|
}
|
||||||
@ -254,6 +247,14 @@ String StateHistTable::GetName(void) const
|
|||||||
|
|
||||||
void StateHistTable::FetchRows(const AddRowFunction& addRowFn)
|
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;
|
Service::Ptr state_hist_service;
|
||||||
|
|
||||||
BOOST_FOREACH(boost::tie(state_hist_service, boost::tuples::ignore), m_ServicesCache) {
|
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;
|
std::map<Service::Ptr, Array::Ptr> m_ServicesCache;
|
||||||
time_t m_TimeFrom;
|
time_t m_TimeFrom;
|
||||||
time_t m_TimeUntil;
|
time_t m_TimeUntil;
|
||||||
|
String m_CompatLogPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user