mirror of https://github.com/Icinga/icinga2.git
Move PerfdataValue() class into base library
This is required for libremote and ApiListener stats in #5133
This commit is contained in:
parent
37f7c7a294
commit
79dcb789c2
|
@ -21,6 +21,7 @@ mkclass_target(datetime.ti datetime.tcpp datetime.thpp)
|
|||
mkclass_target(filelogger.ti filelogger.tcpp filelogger.thpp)
|
||||
mkclass_target(function.ti function.tcpp function.thpp)
|
||||
mkclass_target(logger.ti logger.tcpp logger.thpp)
|
||||
mkclass_target(perfdatavalue.ti perfdatavalue.tcpp perfdatavalue.thpp)
|
||||
mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp)
|
||||
mkclass_target(sysloglogger.ti sysloglogger.tcpp sysloglogger.thpp)
|
||||
|
||||
|
@ -33,7 +34,8 @@ set(base_SOURCES
|
|||
json-script.cpp loader.cpp logger.cpp logger.thpp math-script.cpp
|
||||
netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp
|
||||
object-script.cpp objecttype.cpp primitivetype.cpp process.cpp ringbuffer.cpp scriptframe.cpp
|
||||
function.cpp function.thpp function-script.cpp functionwrapper.cpp scriptglobal.cpp
|
||||
function.cpp function.thpp function-script.cpp functionwrapper.cpp
|
||||
perfdatavalue.cpp perfdatavalue.thpp scriptglobal.cpp
|
||||
scriptutils.cpp serializer.cpp socket.cpp socketevents.cpp socketevents-epoll.cpp socketevents-poll.cpp stacktrace.cpp
|
||||
statsfunction.cpp stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp
|
||||
sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp udpsocket.cpp threadpool.cpp timer.cpp
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "icinga/perfdatavalue.tcpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/perfdatavalue.tcpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
@ -67,7 +67,7 @@ PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
|
|||
spq = perfdata.GetLength();
|
||||
|
||||
String valueStr = perfdata.SubStr(eqp + 1, spq - eqp - 1);
|
||||
|
||||
|
||||
size_t pos = valueStr.FindFirstNotOf("+-0123456789.e");
|
||||
|
||||
double value = Convert::ToDouble(valueStr.SubStr(0, pos));
|
|
@ -20,13 +20,18 @@
|
|||
#ifndef PERFDATAVALUE_H
|
||||
#define PERFDATAVALUE_H
|
||||
|
||||
#include "icinga/i2-icinga.hpp"
|
||||
#include "icinga/perfdatavalue.thpp"
|
||||
#include "base/i2-base.hpp"
|
||||
#include "base/perfdatavalue.thpp"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
||||
class I2_ICINGA_API PerfdataValue : public ObjectImpl<PerfdataValue>
|
||||
/**
|
||||
* A performance data value.
|
||||
*
|
||||
* @ingroup base
|
||||
*/
|
||||
class I2_BASE_API PerfdataValue : public ObjectImpl<PerfdataValue>
|
||||
{
|
||||
public:
|
||||
DECLARE_OBJECT(PerfdataValue);
|
|
@ -17,9 +17,7 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/customvarobject.hpp"
|
||||
|
||||
library icinga;
|
||||
library base;
|
||||
|
||||
namespace icinga
|
||||
{
|
|
@ -21,11 +21,11 @@
|
|||
#include "checker/checkercomponent.tcpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "icinga/cib.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include "base/convert.hpp"
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
#include "icinga/host.hpp"
|
||||
#include "icinga/checkcommand.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "remote/endpoint.hpp"
|
||||
#include "remote/zone.hpp"
|
||||
#include "base/function.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/convert.hpp"
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
#include "db_ido_mysql/idomysqlconnection.hpp"
|
||||
#include "db_ido_mysql/idomysqlconnection.tcpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "db_ido/dbtype.hpp"
|
||||
#include "db_ido/dbvalue.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/exception.hpp"
|
||||
|
|
|
@ -21,11 +21,11 @@
|
|||
#include "db_ido_pgsql/idopgsqlconnection.tcpp"
|
||||
#include "db_ido/dbtype.hpp"
|
||||
#include "db_ido/dbvalue.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/exception.hpp"
|
||||
|
|
|
@ -29,7 +29,6 @@ mkclass_target(icingaapplication.ti icingaapplication.tcpp icingaapplication.thp
|
|||
mkclass_target(customvarobject.ti customvarobject.tcpp customvarobject.thpp)
|
||||
mkclass_target(notificationcommand.ti notificationcommand.tcpp notificationcommand.thpp)
|
||||
mkclass_target(notification.ti notification.tcpp notification.thpp)
|
||||
mkclass_target(perfdatavalue.ti perfdatavalue.tcpp perfdatavalue.thpp)
|
||||
mkclass_target(scheduleddowntime.ti scheduleddowntime.tcpp scheduleddowntime.thpp)
|
||||
mkclass_target(servicegroup.ti servicegroup.tcpp servicegroup.thpp)
|
||||
mkclass_target(service.ti service.tcpp service.thpp)
|
||||
|
@ -47,7 +46,7 @@ set(icinga_SOURCES
|
|||
externalcommandprocessor.cpp host.cpp host.thpp hostgroup.cpp hostgroup.thpp icingaapplication.cpp icingaapplication.thpp
|
||||
icinga-itl.cpp customvarobject.cpp customvarobject.thpp
|
||||
legacytimeperiod.cpp macroprocessor.cpp notificationcommand.cpp notificationcommand.thpp notification.cpp notification.thpp
|
||||
notification-apply.cpp objectutils.cpp perfdatavalue.cpp perfdatavalue.thpp pluginutility.cpp scheduleddowntime.cpp scheduleddowntime.thpp
|
||||
notification-apply.cpp objectutils.cpp pluginutility.cpp scheduleddowntime.cpp scheduleddowntime.thpp
|
||||
scheduleddowntime-apply.cpp service-apply.cpp checkable-check.cpp checkable-comment.cpp
|
||||
service.cpp service.thpp servicegroup.cpp servicegroup.thpp checkable-notification.cpp timeperiod.cpp timeperiod.thpp
|
||||
user.cpp user.thpp usergroup.cpp usergroup.thpp
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
#include "icinga/cib.hpp"
|
||||
#include "icinga/host.hpp"
|
||||
#include "icinga/service.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/statsfunction.hpp"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "icinga/clusterevents.hpp"
|
||||
#include "icinga/service.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "remote/endpoint.hpp"
|
||||
#include "remote/messageorigin.hpp"
|
||||
|
@ -29,6 +28,7 @@
|
|||
#include "base/application.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include "base/initialize.hpp"
|
||||
#include "base/serializer.hpp"
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
#include "icinga/pluginutility.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/process.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
#include "livestatus/livestatuslistener.hpp"
|
||||
#include "livestatus/livestatuslistener.tcpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
#include "methods/clusterzonechecktask.hpp"
|
||||
#include "icinga/checkcommand.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "remote/endpoint.hpp"
|
||||
#include "remote/zone.hpp"
|
||||
#include "base/function.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
#include "icinga/cib.hpp"
|
||||
#include "icinga/service.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/function.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
# include <stdlib.h>
|
||||
#endif /* _WIN32 */
|
||||
#include "methods/nullchecktask.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/function.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
# include <stdlib.h>
|
||||
#endif /* _WIN32 */
|
||||
#include "methods/randomchecktask.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/function.hpp"
|
||||
#include "base/logger.hpp"
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
#include "icinga/notification.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/compatutility.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/tcpsocket.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/stream.hpp"
|
||||
#include "base/networkstream.hpp"
|
||||
#include "base/json.hpp"
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "icinga/compatutility.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/tcpsocket.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/stream.hpp"
|
||||
#include "base/networkstream.hpp"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "icinga/service.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "icinga/checkcommand.hpp"
|
||||
#include "base/tcpsocket.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
|
@ -33,6 +32,7 @@
|
|||
#include "base/logger.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/stream.hpp"
|
||||
#include "base/json.hpp"
|
||||
#include "base/networkstream.hpp"
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
#include "icinga/service.hpp"
|
||||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/compatutility.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "icinga/notification.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/stream.hpp"
|
||||
#include "base/networkstream.hpp"
|
||||
#include "base/json.hpp"
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
#include "icinga/macroprocessor.hpp"
|
||||
#include "icinga/icingaapplication.hpp"
|
||||
#include "icinga/compatutility.hpp"
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/tcpsocket.hpp"
|
||||
#include "base/configtype.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/logger.hpp"
|
||||
#include "base/convert.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include "base/stream.hpp"
|
||||
#include "base/networkstream.hpp"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/dictionary.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/json.hpp"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/dictionary.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/serializer.hpp"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "base/dictionary.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/application.hpp"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
******************************************************************************/
|
||||
|
||||
#include "icinga/perfdatavalue.hpp"
|
||||
#include "base/perfdatavalue.hpp"
|
||||
#include "icinga/pluginutility.hpp"
|
||||
#include <BoostTestTargetConfig.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue