157 const std::string& prefix =
"clickhouse" );
161 static std::shared_ptr<BackendClickHouse>
init_clickhouse(
int argc,
const char*
const* argv,
163 const std::string& prefix =
"clickhouse" );
166 static void help_print(
int argc,
const char*
const* argv );
168 inline std::shared_ptr<LogAgregator> getLogAggregator()
172 inline std::shared_ptr<DebugStream> log()
190 virtual void callback()
noexcept override;
192 virtual void askSensors( UniversalIO::UIOCommand cmd )
override;
198 void init( xmlNode* cnode );
202 std::shared_ptr<SMInterface> shm;
204 using Tag = std::pair<std::string, std::string>;
205 using TagList = std::vector<Tag>;
209 const std::string name;
212 ParamInfo(
const std::string& _name,
const TagList& _tags ):
213 name(_name), tags(_tags) {}
216 std::unordered_map<uniset::ObjectId, ParamInfo> clickhouseParams;
219 timeout_t bufSyncTime = { 5000 };
220 size_t bufSize = { 5000 };
221 size_t bufMaxSize = { 100000 };
222 bool timerIsOn = {
false };
223 timeout_t reconnectTime = { 5000 };
224 std::string lastError;
227 std::shared_ptr<clickhouse::ColumnDateTime64> colTimeStamp;
228 std::shared_ptr<clickhouse::ColumnFloat64> colValue;
229 std::shared_ptr<clickhouse::ColumnString> colName;
230 std::shared_ptr<clickhouse::ColumnString> colNodeName;
231 std::shared_ptr<clickhouse::ColumnString> colProducer;
232 std::shared_ptr<clickhouse::ColumnArray> arrTagKeys;
233 std::shared_ptr<clickhouse::ColumnArray> arrTagValues;
235 void createColumns();
237 static TagList parseTags(
const std::string& tags );
239 std::unique_ptr<uniset::ClickHouseTagsConfig> dyntags;
241 std::string fullTableName;
242 std::unique_ptr<ClickHouseInterface> db;
252 bool connect_ok = {
false };
static std::shared_ptr< BackendClickHouse > init_clickhouse(int argc, const char *const *argv, uniset::ObjectId shmID, const std::shared_ptr< SharedMemory > &ic=nullptr, const std::string &prefix="clickhouse")
Definition BackendClickHouse.cc:241