Remove name and return value for stats functions

fixes #6171
This commit is contained in:
Michael Friedrich 2015-02-07 22:36:17 +01:00
parent 9ce061a8c4
commit ea2ac81003
38 changed files with 50 additions and 85 deletions

View File

@ -29,7 +29,7 @@ REGISTER_TYPE(FileLogger);
REGISTER_STATSFUNCTION(FileLoggerStats, &FileLogger::StatsFunc); REGISTER_STATSFUNCTION(FileLoggerStats, &FileLogger::StatsFunc);
Value FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&) void FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -38,8 +38,6 @@ Value FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
} }
status->Set("filelogger", nodes); status->Set("filelogger", nodes);
return 0;
} }
/** /**

View File

@ -37,7 +37,7 @@ public:
DECLARE_OBJECT(FileLogger); DECLARE_OBJECT(FileLogger);
DECLARE_OBJECTNAME(FileLogger); DECLARE_OBJECTNAME(FileLogger);
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata); static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
virtual void Start(void); virtual void Start(void);

View File

@ -27,9 +27,9 @@ StatsFunction::StatsFunction(const Callback& function)
: m_Callback(function) : m_Callback(function)
{ } { }
Value StatsFunction::Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata) void StatsFunction::Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata)
{ {
return m_Callback(status, perfdata); m_Callback(status, perfdata);
} }
StatsFunctionRegistry *StatsFunctionRegistry::GetInstance(void) StatsFunctionRegistry *StatsFunctionRegistry::GetInstance(void)

View File

@ -40,11 +40,11 @@ class I2_BASE_API StatsFunction : public Object
public: public:
DECLARE_PTR_TYPEDEFS(StatsFunction); DECLARE_PTR_TYPEDEFS(StatsFunction);
typedef boost::function<Value (Dictionary::Ptr& status, Array::Ptr& perfdata)> Callback; typedef boost::function<void (Dictionary::Ptr& status, Array::Ptr& perfdata)> Callback;
StatsFunction(const Callback& function); StatsFunction(const Callback& function);
Value Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata); void Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata);
private: private:
Callback m_Callback; Callback m_Callback;

View File

@ -28,7 +28,7 @@ REGISTER_TYPE(SyslogLogger);
REGISTER_STATSFUNCTION(SyslogLoggerStats, &SyslogLogger::StatsFunc); REGISTER_STATSFUNCTION(SyslogLoggerStats, &SyslogLogger::StatsFunc);
Value SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&) void SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -37,8 +37,6 @@ Value SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
} }
status->Set("sysloglogger", nodes); status->Set("sysloglogger", nodes);
return 0;
} }
/** /**

View File

@ -38,7 +38,7 @@ public:
DECLARE_OBJECT(SyslogLogger); DECLARE_OBJECT(SyslogLogger);
DECLARE_OBJECTNAME(SyslogLogger); DECLARE_OBJECTNAME(SyslogLogger);
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata); static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
protected: protected:
virtual void ProcessLogEntry(const LogEntry& entry); virtual void ProcessLogEntry(const LogEntry& entry);

View File

@ -37,7 +37,7 @@ REGISTER_TYPE(CheckerComponent);
REGISTER_STATSFUNCTION(CheckerComponentStats, &CheckerComponent::StatsFunc); REGISTER_STATSFUNCTION(CheckerComponentStats, &CheckerComponent::StatsFunc);
Value CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) void CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -57,8 +57,6 @@ Value CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Pt
} }
status->Set("checkercomponent", nodes); status->Set("checkercomponent", nodes);
return 0;
} }
void CheckerComponent::OnConfigLoaded(void) void CheckerComponent::OnConfigLoaded(void)

View File

@ -72,7 +72,7 @@ public:
virtual void Start(void); virtual void Start(void);
virtual void Stop(void); virtual void Stop(void);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
unsigned long GetIdleCheckables(void); unsigned long GetIdleCheckables(void);
unsigned long GetPendingCheckables(void); unsigned long GetPendingCheckables(void);

View File

@ -38,7 +38,7 @@ REGISTER_TYPE(CheckResultReader);
REGISTER_STATSFUNCTION(CheckResultReaderStats, &CheckResultReader::StatsFunc); REGISTER_STATSFUNCTION(CheckResultReaderStats, &CheckResultReader::StatsFunc);
Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -47,8 +47,6 @@ Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::P
} }
status->Set("checkresultreader", nodes); status->Set("checkresultreader", nodes);
return 0;
} }
/** /**

View File

@ -38,7 +38,7 @@ public:
DECLARE_OBJECT(CheckResultReader); DECLARE_OBJECT(CheckResultReader);
DECLARE_OBJECTNAME(CheckResultReader); DECLARE_OBJECTNAME(CheckResultReader);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);

View File

@ -44,7 +44,7 @@ REGISTER_SCRIPTFUNCTION(ValidateRotationMethod, &CompatLogger::ValidateRotationM
REGISTER_STATSFUNCTION(CompatLoggerStats, &CompatLogger::StatsFunc); REGISTER_STATSFUNCTION(CompatLoggerStats, &CompatLogger::StatsFunc);
Value CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -53,8 +53,6 @@ Value CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
} }
status->Set("compatlogger", nodes); status->Set("compatlogger", nodes);
return 0;
} }
/** /**

View File

@ -39,7 +39,7 @@ public:
DECLARE_OBJECT(CompatLogger); DECLARE_OBJECT(CompatLogger);
DECLARE_OBJECTNAME(CompatLogger); DECLARE_OBJECTNAME(CompatLogger);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
static void ValidateRotationMethod(const String& location, const CompatLogger::Ptr& object); static void ValidateRotationMethod(const String& location, const CompatLogger::Ptr& object);

View File

@ -31,7 +31,7 @@ REGISTER_TYPE(ExternalCommandListener);
REGISTER_STATSFUNCTION(ExternalCommandListenerStats, &ExternalCommandListener::StatsFunc); REGISTER_STATSFUNCTION(ExternalCommandListenerStats, &ExternalCommandListener::StatsFunc);
Value ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -40,8 +40,6 @@ Value ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Ar
} }
status->Set("externalcommandlistener", nodes); status->Set("externalcommandlistener", nodes);
return 0;
} }
/** /**

View File

@ -39,7 +39,7 @@ public:
DECLARE_OBJECT(ExternalCommandListener); DECLARE_OBJECT(ExternalCommandListener);
DECLARE_OBJECTNAME(ExternalCommandListener); DECLARE_OBJECTNAME(ExternalCommandListener);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);

View File

@ -49,7 +49,7 @@ REGISTER_TYPE(StatusDataWriter);
REGISTER_STATSFUNCTION(StatusDataWriterStats, &StatusDataWriter::StatsFunc); REGISTER_STATSFUNCTION(StatusDataWriterStats, &StatusDataWriter::StatsFunc);
Value StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -58,8 +58,6 @@ Value StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Pt
} }
status->Set("statusdatawriter", nodes); status->Set("statusdatawriter", nodes);
return 0;
} }
/** /**

View File

@ -44,7 +44,7 @@ public:
DECLARE_OBJECT(StatusDataWriter); DECLARE_OBJECT(StatusDataWriter);
DECLARE_OBJECTNAME(StatusDataWriter); DECLARE_OBJECTNAME(StatusDataWriter);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);

View File

@ -43,7 +43,7 @@ IdoMysqlConnection::IdoMysqlConnection(void)
: m_QueryQueue(500000), m_Connected(false) : m_QueryQueue(500000), m_Connected(false)
{ } { }
Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) void IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -61,8 +61,6 @@ Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::
} }
status->Set("idomysqlconnection", nodes); status->Set("idomysqlconnection", nodes);
return 0;
} }
void IdoMysqlConnection::Resume(void) void IdoMysqlConnection::Resume(void)

View File

@ -44,7 +44,7 @@ public:
IdoMysqlConnection(void); IdoMysqlConnection(void);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Resume(void); virtual void Resume(void);

View File

@ -45,7 +45,7 @@ IdoPgsqlConnection::IdoPgsqlConnection(void)
: m_QueryQueue(500000), m_Connection(NULL) : m_QueryQueue(500000), m_Connection(NULL)
{ } { }
Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) void IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -63,8 +63,6 @@ Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::
} }
status->Set("idopgsqlconnection", nodes); status->Set("idopgsqlconnection", nodes);
return 0;
} }
void IdoPgsqlConnection::Resume(void) void IdoPgsqlConnection::Resume(void)

View File

@ -43,8 +43,8 @@ public:
DECLARE_OBJECTNAME(IdoPgsqlConnection); DECLARE_OBJECTNAME(IdoPgsqlConnection);
IdoPgsqlConnection(void); IdoPgsqlConnection(void);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Resume(void); virtual void Resume(void);

View File

@ -244,14 +244,13 @@ std::pair<Dictionary::Ptr, Array::Ptr> CIB::GetFeatureStats(void)
Array::Ptr perfdata = new Array(); Array::Ptr perfdata = new Array();
String name; String name;
Value ret;
BOOST_FOREACH(tie(name, boost::tuples::ignore), StatsFunctionRegistry::GetInstance()->GetItems()) { BOOST_FOREACH(tie(name, boost::tuples::ignore), StatsFunctionRegistry::GetInstance()->GetItems()) {
StatsFunction::Ptr func = StatsFunctionRegistry::GetInstance()->GetItem(name); StatsFunction::Ptr func = StatsFunctionRegistry::GetInstance()->GetItem(name);
if (!func) if (!func)
BOOST_THROW_EXCEPTION(std::invalid_argument("Function '" + name + "' does not exist.")); BOOST_THROW_EXCEPTION(std::invalid_argument("Function '" + name + "' does not exist."));
ret = func->Invoke(status, perfdata); func->Invoke(status, perfdata);
} }
return std::make_pair(status, perfdata); return std::make_pair(status, perfdata);

View File

@ -63,7 +63,7 @@ void IcingaApplication::StaticInitialize(void)
REGISTER_STATSFUNCTION(IcingaApplicationStats, &IcingaApplication::StatsFunc); REGISTER_STATSFUNCTION(IcingaApplicationStats, &IcingaApplication::StatsFunc);
Value IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata) void IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -84,8 +84,6 @@ Value IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata
} }
status->Set("icingaapplication", nodes); status->Set("icingaapplication", nodes);
return 0;
} }
/** /**

View File

@ -42,7 +42,7 @@ public:
int Main(void); int Main(void);
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata); static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
static IcingaApplication::Ptr GetInstance(void); static IcingaApplication::Ptr GetInstance(void);

View File

@ -35,7 +35,7 @@ REGISTER_TYPE(IcingaStatusWriter);
REGISTER_STATSFUNCTION(IcingaStatusWriterStats, &IcingaStatusWriter::StatsFunc); REGISTER_STATSFUNCTION(IcingaStatusWriterStats, &IcingaStatusWriter::StatsFunc);
Value IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata) void IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -44,8 +44,6 @@ Value IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdat
} }
status->Set("icingastatuswriter", nodes); status->Set("icingastatuswriter", nodes);
return 0;
} }
/** /**

View File

@ -35,7 +35,7 @@ public:
DECLARE_OBJECT(IcingaStatusWriter); DECLARE_OBJECT(IcingaStatusWriter);
DECLARE_OBJECTNAME(IcingaStatusWriter); DECLARE_OBJECTNAME(IcingaStatusWriter);
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata); static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
static Dictionary::Ptr GetStatusData(void); static Dictionary::Ptr GetStatusData(void);
protected: protected:

View File

@ -43,7 +43,7 @@ static boost::mutex l_ComponentMutex;
REGISTER_STATSFUNCTION(LivestatusListenerStats, &LivestatusListener::StatsFunc); REGISTER_STATSFUNCTION(LivestatusListenerStats, &LivestatusListener::StatsFunc);
Value LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata) void LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -57,8 +57,6 @@ Value LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::
} }
status->Set("livestatuslistener", nodes); status->Set("livestatuslistener", nodes);
return 0;
} }
/** /**

View File

@ -39,7 +39,7 @@ public:
DECLARE_OBJECT(LivestatusListener); DECLARE_OBJECT(LivestatusListener);
DECLARE_OBJECTNAME(LivestatusListener); DECLARE_OBJECTNAME(LivestatusListener);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
static int GetClientsConnected(void); static int GetClientsConnected(void);
static int GetConnections(void); static int GetConnections(void);

View File

@ -34,7 +34,7 @@ REGISTER_TYPE(NotificationComponent);
REGISTER_STATSFUNCTION(NotificationComponentStats, &NotificationComponent::StatsFunc); REGISTER_STATSFUNCTION(NotificationComponentStats, &NotificationComponent::StatsFunc);
Value NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -43,8 +43,6 @@ Value NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Arra
} }
status->Set("notificationcomponent", nodes); status->Set("notificationcomponent", nodes);
return 0;
} }
/** /**

View File

@ -37,7 +37,7 @@ public:
DECLARE_OBJECT(NotificationComponent); DECLARE_OBJECT(NotificationComponent);
DECLARE_OBJECTNAME(NotificationComponent); DECLARE_OBJECTNAME(NotificationComponent);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
virtual void Start(void); virtual void Start(void);

View File

@ -46,16 +46,16 @@ protected:
private: private:
Stream::Ptr m_Stream; Stream::Ptr m_Stream;
Timer::Ptr m_ReconnectTimer; Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr); void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
void NotificationToUserHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable, void NotificationToUserHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr, const User::Ptr& user, NotificationType notification_type, CheckResult::Ptr const& cr,
const String& author, const String& comment_text, const String& command_name); const String& author, const String& comment_text, const String& command_name);
String ComposeGelfMessage(const Dictionary::Ptr& fields, const String& source); String ComposeGelfMessage(const Dictionary::Ptr& fields, const String& source);
void StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type); void StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type);
void SendLogMessage(const String& gelf); void SendLogMessage(const String& gelf);
void ReconnectTimerHandler(void); void ReconnectTimerHandler(void);
}; };

View File

@ -46,7 +46,7 @@ REGISTER_TYPE(GraphiteWriter);
REGISTER_STATSFUNCTION(GraphiteWriterStats, &GraphiteWriter::StatsFunc); REGISTER_STATSFUNCTION(GraphiteWriterStats, &GraphiteWriter::StatsFunc);
Value GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -55,8 +55,6 @@ Value GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&
} }
status->Set("graphitewriter", nodes); status->Set("graphitewriter", nodes);
return 0;
} }
void GraphiteWriter::Start(void) void GraphiteWriter::Start(void)

View File

@ -41,14 +41,14 @@ public:
DECLARE_OBJECT(GraphiteWriter); DECLARE_OBJECT(GraphiteWriter);
DECLARE_OBJECTNAME(GraphiteWriter); DECLARE_OBJECTNAME(GraphiteWriter);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);
private: private:
Stream::Ptr m_Stream; Stream::Ptr m_Stream;
Timer::Ptr m_ReconnectTimer; Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr); void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);

View File

@ -46,7 +46,7 @@ REGISTER_TYPE(OpenTsdbWriter);
REGISTER_STATSFUNCTION(OpenTsdbWriterStats, &OpenTsdbWriter::StatsFunc); REGISTER_STATSFUNCTION(OpenTsdbWriterStats, &OpenTsdbWriter::StatsFunc);
Value OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -55,8 +55,6 @@ Value OpenTsdbWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&
} }
status->Set("opentsdbwriter", nodes); status->Set("opentsdbwriter", nodes);
return 0;
} }
void OpenTsdbWriter::Start(void) void OpenTsdbWriter::Start(void)

View File

@ -41,14 +41,14 @@ public:
DECLARE_OBJECT(OpenTsdbWriter); DECLARE_OBJECT(OpenTsdbWriter);
DECLARE_OBJECTNAME(OpenTsdbWriter); DECLARE_OBJECTNAME(OpenTsdbWriter);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);
private: private:
Stream::Ptr m_Stream; Stream::Ptr m_Stream;
Timer::Ptr m_ReconnectTimer; Timer::Ptr m_ReconnectTimer;
void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr); void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);

View File

@ -36,7 +36,7 @@ REGISTER_TYPE(PerfdataWriter);
REGISTER_STATSFUNCTION(PerfdataWriterStats, &PerfdataWriter::StatsFunc); REGISTER_STATSFUNCTION(PerfdataWriterStats, &PerfdataWriter::StatsFunc);
Value PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&) void PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
@ -45,8 +45,6 @@ Value PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&
} }
status->Set("perfdatawriter", nodes); status->Set("perfdatawriter", nodes);
return 0;
} }
void PerfdataWriter::Start(void) void PerfdataWriter::Start(void)

View File

@ -40,7 +40,7 @@ public:
DECLARE_OBJECT(PerfdataWriter); DECLARE_OBJECT(PerfdataWriter);
DECLARE_OBJECTNAME(PerfdataWriter); DECLARE_OBJECTNAME(PerfdataWriter);
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata); static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
protected: protected:
virtual void Start(void); virtual void Start(void);

View File

@ -747,7 +747,7 @@ void ApiListener::ReplayLog(const ApiClient::Ptr& client)
} }
} }
Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata) void ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
{ {
Dictionary::Ptr nodes = new Dictionary(); Dictionary::Ptr nodes = new Dictionary();
std::pair<Dictionary::Ptr, Dictionary::Ptr> stats; std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
@ -755,7 +755,7 @@ Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
ApiListener::Ptr listener = ApiListener::GetInstance(); ApiListener::Ptr listener = ApiListener::GetInstance();
if (!listener) if (!listener)
return 0; return;
stats = listener->GetStatus(); stats = listener->GetStatus();
@ -764,8 +764,6 @@ Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
perfdata->Add("'api_" + kv.first + "'=" + Convert::ToString(kv.second)); perfdata->Add("'api_" + kv.first + "'=" + Convert::ToString(kv.second));
status->Set("api", stats.first); status->Set("api", stats.first);
return 0;
} }
std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void) std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)

View File

@ -59,7 +59,7 @@ public:
void SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionary::Ptr& message); void SyncSendMessage(const Endpoint::Ptr& endpoint, const Dictionary::Ptr& message);
void RelayMessage(const MessageOrigin& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log); void RelayMessage(const MessageOrigin& origin, const DynamicObject::Ptr& secobj, const Dictionary::Ptr& message, bool log);
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata); static void StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
std::pair<Dictionary::Ptr, Dictionary::Ptr> GetStatus(void); std::pair<Dictionary::Ptr, Dictionary::Ptr> GetStatus(void);
void AddAnonymousClient(const ApiClient::Ptr& aclient); void AddAnonymousClient(const ApiClient::Ptr& aclient);