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"
106 const std::string& prefix =
"opentsdb" );
110 static std::shared_ptr<BackendOpenTSDB>
init_opendtsdb(
int argc,
const char*
const* argv,
112 const std::string& prefix =
"opentsdb" );
115 static void help_print(
int argc,
const char*
const* argv );
117 inline std::shared_ptr<LogAgregator> getLogAggregator()
121 inline std::shared_ptr<DebugStream> log()
139 virtual void callback() noexcept
override;
141 virtual void askSensors( UniversalIO::UIOCommand cmd )
override;
145 virtual std::string getMonitInfo()
const override;
147 void init( xmlNode* cnode );
151 std::shared_ptr<SMInterface> shm;
155 const std::string name;
156 const std::string tags;
158 ParamInfo(
const std::string& _name,
const std::string& _tags ):
159 name(_name), tags(_tags) {}
162 std::string tsdbPrefix;
163 std::string tsdbTags;
164 std::unordered_map<uniset::ObjectId, ParamInfo> tsdbParams;
166 timeout_t bufSyncTime = { 5000 };
167 size_t bufSize = { 500 };
168 size_t bufMaxSize = { 5000 };
169 bool timerIsOn = {
false };
170 timeout_t reconnectTime = { 5000 };
171 std::string lastError;
176 std::deque<std::string> buf;
179 std::shared_ptr<UTCPStream> tcp;
180 std::string host = {
"localhost" };
190 #endif // _BackendOpenTSDB_H_