17#ifndef _BackendOpenTSDB_H_
18#define _BackendOpenTSDB_H_
22#include <unordered_map>
24#include "UObject_SK.h"
25#include "SMInterface.h"
26#include "SharedMemory.h"
27#include "extensions/Extensions.h"
28#include "UTCPStream.h"
108 const std::string& prefix =
"opentsdb" );
112 static std::shared_ptr<BackendOpenTSDB>
init_opendtsdb(
int argc,
const char*
const* argv,
114 const std::string& prefix =
"opentsdb" );
117 static void help_print(
int argc,
const char*
const* argv );
119 inline std::shared_ptr<LogAgregator> getLogAggregator()
123 inline std::shared_ptr<DebugStream> log()
141 virtual void callback()
noexcept override;
143 virtual void askSensors( UniversalIO::UIOCommand cmd )
override;
149 void init( xmlNode* cnode );
153 std::shared_ptr<SMInterface> shm;
157 const std::string name;
158 const std::string tags;
160 ParamInfo(
const std::string& _name,
const std::string& _tags ):
161 name(_name), tags(_tags) {}
164 std::string tsdbPrefix;
165 std::string tsdbTags;
166 std::unordered_map<uniset::ObjectId, ParamInfo> tsdbParams;
168 timeout_t bufSyncTime = { 5000 };
169 size_t bufSize = { 500 };
170 size_t bufMaxSize = { 5000 };
171 bool timerIsOn = {
false };
172 timeout_t reconnectTime = { 5000 };
173 std::string lastError;
178 std::deque<std::string> buf;
181 std::shared_ptr<UTCPStream> tcp;
182 std::string host = {
"localhost" };
Definition UObject_SK.h:30
Definition BackendOpenTSDB.h:105
virtual std::string getMonitInfo() const override
Definition BackendOpenTSDB.cc:431
static std::shared_ptr< BackendOpenTSDB > init_opendtsdb(int argc, const char *const *argv, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="opentsdb")
Definition BackendOpenTSDB.cc:180
virtual void callback() noexcept override
Definition BackendOpenTSDB.cc:214
static void help_print(int argc, const char *const *argv)
Definition BackendOpenTSDB.cc:145
Definition MessageType.h:127
Definition MessageType.h:171
Definition MessageType.h:214
Definition Calibration.h:27
long ObjectId
Definition UniSetTypes_i.idl:30
Definition BackendOpenTSDB.h:156