155 const std::string& prefix =
"clickhouse" );
159 static std::shared_ptr<BackendClickHouse>
init_clickhouse(
int argc,
const char*
const* argv,
161 const std::string& prefix =
"clickhouse" );
164 static void help_print(
int argc,
const char*
const* argv );
166 inline std::shared_ptr<LogAgregator> getLogAggregator()
170 inline std::shared_ptr<DebugStream> log()
188 virtual void callback()
noexcept override;
190 virtual void askSensors( UniversalIO::UIOCommand cmd )
override;
196 void init( xmlNode* cnode );
200 std::shared_ptr<SMInterface> shm;
202 using Tag = std::pair<std::string, std::string>;
203 using TagList = std::vector<Tag>;
207 const std::string name;
210 ParamInfo(
const std::string& _name,
const TagList& _tags ):
211 name(_name), tags(_tags) {}
214 std::unordered_map<uniset::ObjectId, ParamInfo> clickhouseParams;
217 timeout_t bufSyncTime = { 5000 };
218 size_t bufSize = { 5000 };
219 size_t bufMaxSize = { 100000 };
220 bool timerIsOn = {
false };
221 timeout_t reconnectTime = { 5000 };
222 std::string lastError;
225 std::shared_ptr<clickhouse::ColumnDateTime64> colTimeStamp;
226 std::shared_ptr<clickhouse::ColumnFloat64> colValue;
227 std::shared_ptr<clickhouse::ColumnString> colName;
228 std::shared_ptr<clickhouse::ColumnString> colNodeName;
229 std::shared_ptr<clickhouse::ColumnString> colProducer;
230 std::shared_ptr<clickhouse::ColumnArray> arrTagKeys;
231 std::shared_ptr<clickhouse::ColumnArray> arrTagValues;
233 void createColumns();
235 static TagList parseTags(
const std::string& tags );
237 std::unique_ptr<uniset::ClickHouseTagsConfig> dyntags;
239 std::string fullTableName;
240 std::unique_ptr<ClickHouseInterface> db;
250 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:239