ADCharts.cc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #include "ADCharts.h"
  3. #include "Config.h"
  4. void ml::updateDimensionsChart(RRDHOST *RH, const MachineLearningStats &MLS) {
  5. /*
  6. * Machine learning status
  7. */
  8. {
  9. static thread_local RRDSET *MachineLearningStatusRS = nullptr;
  10. static thread_local RRDDIM *Enabled = nullptr;
  11. static thread_local RRDDIM *DisabledUE = nullptr;
  12. static thread_local RRDDIM *DisabledSP = nullptr;
  13. if (!MachineLearningStatusRS) {
  14. std::stringstream IdSS, NameSS;
  15. IdSS << "machine_learning_status_on_" << localhost->machine_guid;
  16. NameSS << "machine_learning_status_on_" << rrdhost_hostname(localhost);
  17. MachineLearningStatusRS = rrdset_create(
  18. RH,
  19. "netdata", // type
  20. IdSS.str().c_str(), // id
  21. NameSS.str().c_str(), // name
  22. NETDATA_ML_CHART_FAMILY, // family
  23. "netdata.machine_learning_status", // ctx
  24. "Machine learning status", // title
  25. "dimensions", // units
  26. NETDATA_ML_PLUGIN, // plugin
  27. NETDATA_ML_MODULE_TRAINING, // module
  28. NETDATA_ML_CHART_PRIO_MACHINE_LEARNING_STATUS, // priority
  29. RH->rrd_update_every, // update_every
  30. RRDSET_TYPE_LINE // chart_type
  31. );
  32. rrdset_flag_set(MachineLearningStatusRS , RRDSET_FLAG_ANOMALY_DETECTION);
  33. Enabled = rrddim_add(MachineLearningStatusRS, "enabled", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  34. DisabledUE = rrddim_add(MachineLearningStatusRS, "disabled-ue", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  35. DisabledSP = rrddim_add(MachineLearningStatusRS, "disabled-sp", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  36. }
  37. rrddim_set_by_pointer(MachineLearningStatusRS, Enabled, MLS.NumMachineLearningStatusEnabled);
  38. rrddim_set_by_pointer(MachineLearningStatusRS, DisabledUE, MLS.NumMachineLearningStatusDisabledUE);
  39. rrddim_set_by_pointer(MachineLearningStatusRS, DisabledSP, MLS.NumMachineLearningStatusDisabledSP);
  40. rrdset_done(MachineLearningStatusRS);
  41. }
  42. /*
  43. * Metric type
  44. */
  45. {
  46. static thread_local RRDSET *MetricTypesRS = nullptr;
  47. static thread_local RRDDIM *Constant = nullptr;
  48. static thread_local RRDDIM *Variable = nullptr;
  49. if (!MetricTypesRS) {
  50. std::stringstream IdSS, NameSS;
  51. IdSS << "metric_types_on_" << localhost->machine_guid;
  52. NameSS << "metric_types_on_" << rrdhost_hostname(localhost);
  53. MetricTypesRS = rrdset_create(
  54. RH,
  55. "netdata", // type
  56. IdSS.str().c_str(), // id
  57. NameSS.str().c_str(), // name
  58. NETDATA_ML_CHART_FAMILY, // family
  59. "netdata.metric_types", // ctx
  60. "Dimensions by metric type", // title
  61. "dimensions", // units
  62. NETDATA_ML_PLUGIN, // plugin
  63. NETDATA_ML_MODULE_TRAINING, // module
  64. NETDATA_ML_CHART_PRIO_METRIC_TYPES, // priority
  65. RH->rrd_update_every, // update_every
  66. RRDSET_TYPE_LINE // chart_type
  67. );
  68. rrdset_flag_set(MetricTypesRS, RRDSET_FLAG_ANOMALY_DETECTION);
  69. Constant = rrddim_add(MetricTypesRS, "constant", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  70. Variable = rrddim_add(MetricTypesRS, "variable", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  71. }
  72. rrddim_set_by_pointer(MetricTypesRS, Constant, MLS.NumMetricTypeConstant);
  73. rrddim_set_by_pointer(MetricTypesRS, Variable, MLS.NumMetricTypeVariable);
  74. rrdset_done(MetricTypesRS);
  75. }
  76. /*
  77. * Training status
  78. */
  79. {
  80. static thread_local RRDSET *TrainingStatusRS = nullptr;
  81. static thread_local RRDDIM *Untrained = nullptr;
  82. static thread_local RRDDIM *PendingWithoutModel = nullptr;
  83. static thread_local RRDDIM *Trained = nullptr;
  84. static thread_local RRDDIM *PendingWithModel = nullptr;
  85. if (!TrainingStatusRS) {
  86. std::stringstream IdSS, NameSS;
  87. IdSS << "training_status_on_" << localhost->machine_guid;
  88. NameSS << "training_status_on_" << rrdhost_hostname(localhost);
  89. TrainingStatusRS = rrdset_create(
  90. RH,
  91. "netdata", // type
  92. IdSS.str().c_str(), // id
  93. NameSS.str().c_str(), // name
  94. NETDATA_ML_CHART_FAMILY, // family
  95. "netdata.training_status", // ctx
  96. "Training status of dimensions", // title
  97. "dimensions", // units
  98. NETDATA_ML_PLUGIN, // plugin
  99. NETDATA_ML_MODULE_TRAINING, // module
  100. NETDATA_ML_CHART_PRIO_TRAINING_STATUS, // priority
  101. RH->rrd_update_every, // update_every
  102. RRDSET_TYPE_LINE // chart_type
  103. );
  104. rrdset_flag_set(TrainingStatusRS, RRDSET_FLAG_ANOMALY_DETECTION);
  105. Untrained = rrddim_add(TrainingStatusRS, "untrained", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  106. PendingWithoutModel = rrddim_add(TrainingStatusRS, "pending-without-model", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  107. Trained = rrddim_add(TrainingStatusRS, "trained", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  108. PendingWithModel = rrddim_add(TrainingStatusRS, "pending-with-model", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  109. }
  110. rrddim_set_by_pointer(TrainingStatusRS, Untrained, MLS.NumTrainingStatusUntrained);
  111. rrddim_set_by_pointer(TrainingStatusRS, PendingWithoutModel, MLS.NumTrainingStatusPendingWithoutModel);
  112. rrddim_set_by_pointer(TrainingStatusRS, Trained, MLS.NumTrainingStatusTrained);
  113. rrddim_set_by_pointer(TrainingStatusRS, PendingWithModel, MLS.NumTrainingStatusPendingWithModel);
  114. rrdset_done(TrainingStatusRS);
  115. }
  116. /*
  117. * Prediction status
  118. */
  119. {
  120. static thread_local RRDSET *PredictionRS = nullptr;
  121. static thread_local RRDDIM *Anomalous = nullptr;
  122. static thread_local RRDDIM *Normal = nullptr;
  123. if (!PredictionRS) {
  124. std::stringstream IdSS, NameSS;
  125. IdSS << "dimensions_on_" << localhost->machine_guid;
  126. NameSS << "dimensions_on_" << rrdhost_hostname(localhost);
  127. PredictionRS = rrdset_create(
  128. RH,
  129. "anomaly_detection", // type
  130. IdSS.str().c_str(), // id
  131. NameSS.str().c_str(), // name
  132. "dimensions", // family
  133. "anomaly_detection.dimensions", // ctx
  134. "Anomaly detection dimensions", // title
  135. "dimensions", // units
  136. NETDATA_ML_PLUGIN, // plugin
  137. NETDATA_ML_MODULE_TRAINING, // module
  138. ML_CHART_PRIO_DIMENSIONS, // priority
  139. RH->rrd_update_every, // update_every
  140. RRDSET_TYPE_LINE // chart_type
  141. );
  142. rrdset_flag_set(PredictionRS, RRDSET_FLAG_ANOMALY_DETECTION);
  143. Anomalous = rrddim_add(PredictionRS, "anomalous", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  144. Normal = rrddim_add(PredictionRS, "normal", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  145. }
  146. rrddim_set_by_pointer(PredictionRS, Anomalous, MLS.NumAnomalousDimensions);
  147. rrddim_set_by_pointer(PredictionRS, Normal, MLS.NumNormalDimensions);
  148. rrdset_done(PredictionRS);
  149. }
  150. }
  151. void ml::updateHostAndDetectionRateCharts(RRDHOST *RH, collected_number AnomalyRate) {
  152. static thread_local RRDSET *HostRateRS = nullptr;
  153. static thread_local RRDDIM *AnomalyRateRD = nullptr;
  154. if (!HostRateRS) {
  155. std::stringstream IdSS, NameSS;
  156. IdSS << "anomaly_rate_on_" << localhost->machine_guid;
  157. NameSS << "anomaly_rate_on_" << rrdhost_hostname(localhost);
  158. HostRateRS = rrdset_create(
  159. RH,
  160. "anomaly_detection", // type
  161. IdSS.str().c_str(), // id
  162. NameSS.str().c_str(), // name
  163. "anomaly_rate", // family
  164. "anomaly_detection.anomaly_rate", // ctx
  165. "Percentage of anomalous dimensions", // title
  166. "percentage", // units
  167. NETDATA_ML_PLUGIN, // plugin
  168. NETDATA_ML_MODULE_DETECTION, // module
  169. ML_CHART_PRIO_ANOMALY_RATE, // priority
  170. RH->rrd_update_every, // update_every
  171. RRDSET_TYPE_LINE // chart_type
  172. );
  173. rrdset_flag_set(HostRateRS, RRDSET_FLAG_ANOMALY_DETECTION);
  174. AnomalyRateRD = rrddim_add(HostRateRS, "anomaly_rate", NULL,
  175. 1, 100, RRD_ALGORITHM_ABSOLUTE);
  176. }
  177. rrddim_set_by_pointer(HostRateRS, AnomalyRateRD, AnomalyRate);
  178. rrdset_done(HostRateRS);
  179. static thread_local RRDSET *AnomalyDetectionRS = nullptr;
  180. static thread_local RRDDIM *AboveThresholdRD = nullptr;
  181. static thread_local RRDDIM *NewAnomalyEventRD = nullptr;
  182. if (!AnomalyDetectionRS) {
  183. std::stringstream IdSS, NameSS;
  184. IdSS << "anomaly_detection_on_" << localhost->machine_guid;
  185. NameSS << "anomaly_detection_on_" << rrdhost_hostname(localhost);
  186. AnomalyDetectionRS = rrdset_create(
  187. RH,
  188. "anomaly_detection", // type
  189. IdSS.str().c_str(), // id
  190. NameSS.str().c_str(), // name
  191. "anomaly_detection", // family
  192. "anomaly_detection.detector_events", // ctx
  193. "Anomaly detection events", // title
  194. "percentage", // units
  195. NETDATA_ML_PLUGIN, // plugin
  196. NETDATA_ML_MODULE_DETECTION, // module
  197. ML_CHART_PRIO_DETECTOR_EVENTS, // priority
  198. RH->rrd_update_every, // update_every
  199. RRDSET_TYPE_LINE // chart_type
  200. );
  201. rrdset_flag_set(AnomalyDetectionRS, RRDSET_FLAG_ANOMALY_DETECTION);
  202. AboveThresholdRD = rrddim_add(AnomalyDetectionRS, "above_threshold", NULL,
  203. 1, 1, RRD_ALGORITHM_ABSOLUTE);
  204. NewAnomalyEventRD = rrddim_add(AnomalyDetectionRS, "new_anomaly_event", NULL,
  205. 1, 1, RRD_ALGORITHM_ABSOLUTE);
  206. }
  207. /*
  208. * Compute the values of the dimensions based on the host rate chart
  209. */
  210. ONEWAYALLOC *OWA = onewayalloc_create(0);
  211. time_t Now = now_realtime_sec();
  212. time_t Before = Now - RH->rrd_update_every;
  213. time_t After = Before - Cfg.AnomalyDetectionQueryDuration;
  214. RRDR_OPTIONS Options = static_cast<RRDR_OPTIONS>(0x00000000);
  215. RRDR *R = rrd2rrdr_legacy(
  216. OWA, HostRateRS,
  217. 1 /* points wanted */,
  218. After,
  219. Before,
  220. Cfg.AnomalyDetectionGroupingMethod,
  221. 0 /* resampling time */,
  222. Options, "anomaly_rate",
  223. NULL /* group options */,
  224. 0, /* timeout */
  225. 0, /* tier */
  226. QUERY_SOURCE_ML,
  227. STORAGE_PRIORITY_BEST_EFFORT
  228. );
  229. if(R) {
  230. if(R->d == 1 && R->n == 1 && R->rows == 1) {
  231. static thread_local bool PrevAboveThreshold = false;
  232. bool AboveThreshold = R->v[0] >= Cfg.HostAnomalyRateThreshold;
  233. bool NewAnomalyEvent = AboveThreshold && !PrevAboveThreshold;
  234. PrevAboveThreshold = AboveThreshold;
  235. rrddim_set_by_pointer(AnomalyDetectionRS, AboveThresholdRD, AboveThreshold);
  236. rrddim_set_by_pointer(AnomalyDetectionRS, NewAnomalyEventRD, NewAnomalyEvent);
  237. rrdset_done(AnomalyDetectionRS);
  238. }
  239. rrdr_free(OWA, R);
  240. }
  241. onewayalloc_destroy(OWA);
  242. }
  243. void ml::updateResourceUsageCharts(RRDHOST *RH, const struct rusage &PredictionRU, const struct rusage &TrainingRU) {
  244. /*
  245. * prediction rusage
  246. */
  247. {
  248. static thread_local RRDSET *RS = nullptr;
  249. static thread_local RRDDIM *User = nullptr;
  250. static thread_local RRDDIM *System = nullptr;
  251. if (!RS) {
  252. std::stringstream IdSS, NameSS;
  253. IdSS << "prediction_usage_for_" << RH->machine_guid;
  254. NameSS << "prediction_usage_for_" << rrdhost_hostname(RH);
  255. RS = rrdset_create_localhost(
  256. "netdata", // type
  257. IdSS.str().c_str(), // id
  258. NameSS.str().c_str(), // name
  259. NETDATA_ML_CHART_FAMILY, // family
  260. "netdata.prediction_usage", // ctx
  261. "Prediction resource usage", // title
  262. "milliseconds/s", // units
  263. NETDATA_ML_PLUGIN, // plugin
  264. NETDATA_ML_MODULE_PREDICTION, // module
  265. NETDATA_ML_CHART_PRIO_PREDICTION_USAGE, // priority
  266. RH->rrd_update_every, // update_every
  267. RRDSET_TYPE_STACKED // chart_type
  268. );
  269. rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION);
  270. User = rrddim_add(RS, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
  271. System = rrddim_add(RS, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
  272. }
  273. rrddim_set_by_pointer(RS, User, PredictionRU.ru_utime.tv_sec * 1000000ULL + PredictionRU.ru_utime.tv_usec);
  274. rrddim_set_by_pointer(RS, System, PredictionRU.ru_stime.tv_sec * 1000000ULL + PredictionRU.ru_stime.tv_usec);
  275. rrdset_done(RS);
  276. }
  277. /*
  278. * training rusage
  279. */
  280. {
  281. static thread_local RRDSET *RS = nullptr;
  282. static thread_local RRDDIM *User = nullptr;
  283. static thread_local RRDDIM *System = nullptr;
  284. if (!RS) {
  285. std::stringstream IdSS, NameSS;
  286. IdSS << "training_usage_for_" << RH->machine_guid;
  287. NameSS << "training_usage_for_" << rrdhost_hostname(RH);
  288. RS = rrdset_create_localhost(
  289. "netdata", // type
  290. IdSS.str().c_str(), // id
  291. NameSS.str().c_str(), // name
  292. NETDATA_ML_CHART_FAMILY, // family
  293. "netdata.training_usage", // ctx
  294. "Training resource usage", // title
  295. "milliseconds/s", // units
  296. NETDATA_ML_PLUGIN, // plugin
  297. NETDATA_ML_MODULE_TRAINING, // module
  298. NETDATA_ML_CHART_PRIO_TRAINING_USAGE, // priority
  299. RH->rrd_update_every, // update_every
  300. RRDSET_TYPE_STACKED // chart_type
  301. );
  302. rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION);
  303. User = rrddim_add(RS, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
  304. System = rrddim_add(RS, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL);
  305. }
  306. rrddim_set_by_pointer(RS, User, TrainingRU.ru_utime.tv_sec * 1000000ULL + TrainingRU.ru_utime.tv_usec);
  307. rrddim_set_by_pointer(RS, System, TrainingRU.ru_stime.tv_sec * 1000000ULL + TrainingRU.ru_stime.tv_usec);
  308. rrdset_done(RS);
  309. }
  310. }
  311. void ml::updateTrainingStatisticsChart(RRDHOST *RH, const TrainingStats &TS) {
  312. /*
  313. * queue stats
  314. */
  315. {
  316. static thread_local RRDSET *RS = nullptr;
  317. static thread_local RRDDIM *QueueSize = nullptr;
  318. static thread_local RRDDIM *PoppedItems = nullptr;
  319. if (!RS) {
  320. std::stringstream IdSS, NameSS;
  321. IdSS << "queue_stats_on_" << localhost->machine_guid;
  322. NameSS << "queue_stats_on_" << rrdhost_hostname(localhost);
  323. RS = rrdset_create(
  324. RH,
  325. "netdata", // type
  326. IdSS.str().c_str(), // id
  327. NameSS.str().c_str(), // name
  328. NETDATA_ML_CHART_FAMILY, // family
  329. "netdata.queue_stats", // ctx
  330. "Training queue stats", // title
  331. "items", // units
  332. NETDATA_ML_PLUGIN, // plugin
  333. NETDATA_ML_MODULE_TRAINING, // module
  334. NETDATA_ML_CHART_PRIO_QUEUE_STATS, // priority
  335. RH->rrd_update_every, // update_every
  336. RRDSET_TYPE_LINE// chart_type
  337. );
  338. rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION);
  339. QueueSize = rrddim_add(RS, "queue_size", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  340. PoppedItems = rrddim_add(RS, "popped_items", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  341. }
  342. rrddim_set_by_pointer(RS, QueueSize, TS.QueueSize);
  343. rrddim_set_by_pointer(RS, PoppedItems, TS.NumPoppedItems);
  344. rrdset_done(RS);
  345. }
  346. /*
  347. * training stats
  348. */
  349. {
  350. static thread_local RRDSET *RS = nullptr;
  351. static thread_local RRDDIM *Allotted = nullptr;
  352. static thread_local RRDDIM *Consumed = nullptr;
  353. static thread_local RRDDIM *Remaining = nullptr;
  354. if (!RS) {
  355. std::stringstream IdSS, NameSS;
  356. IdSS << "training_time_stats_on_" << localhost->machine_guid;
  357. NameSS << "training_time_stats_on_" << rrdhost_hostname(localhost);
  358. RS = rrdset_create(
  359. RH,
  360. "netdata", // type
  361. IdSS.str().c_str(), // id
  362. NameSS.str().c_str(), // name
  363. NETDATA_ML_CHART_FAMILY, // family
  364. "netdata.training_time_stats", // ctx
  365. "Training time stats", // title
  366. "milliseconds", // units
  367. NETDATA_ML_PLUGIN, // plugin
  368. NETDATA_ML_MODULE_TRAINING, // module
  369. NETDATA_ML_CHART_PRIO_TRAINING_TIME_STATS, // priority
  370. RH->rrd_update_every, // update_every
  371. RRDSET_TYPE_LINE// chart_type
  372. );
  373. rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION);
  374. Allotted = rrddim_add(RS, "allotted", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
  375. Consumed = rrddim_add(RS, "consumed", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
  376. Remaining = rrddim_add(RS, "remaining", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE);
  377. }
  378. rrddim_set_by_pointer(RS, Allotted, TS.AllottedUT);
  379. rrddim_set_by_pointer(RS, Consumed, TS.ConsumedUT);
  380. rrddim_set_by_pointer(RS, Remaining, TS.RemainingUT);
  381. rrdset_done(RS);
  382. }
  383. /*
  384. * training result stats
  385. */
  386. {
  387. static thread_local RRDSET *RS = nullptr;
  388. static thread_local RRDDIM *Ok = nullptr;
  389. static thread_local RRDDIM *InvalidQueryTimeRange = nullptr;
  390. static thread_local RRDDIM *NotEnoughCollectedValues = nullptr;
  391. static thread_local RRDDIM *NullAcquiredDimension = nullptr;
  392. static thread_local RRDDIM *ChartUnderReplication = nullptr;
  393. if (!RS) {
  394. std::stringstream IdSS, NameSS;
  395. IdSS << "training_results_on_" << localhost->machine_guid;
  396. NameSS << "training_results_on_" << rrdhost_hostname(localhost);
  397. RS = rrdset_create(
  398. RH,
  399. "netdata", // type
  400. IdSS.str().c_str(), // id
  401. NameSS.str().c_str(), // name
  402. NETDATA_ML_CHART_FAMILY, // family
  403. "netdata.training_results", // ctx
  404. "Training results", // title
  405. "events", // units
  406. NETDATA_ML_PLUGIN, // plugin
  407. NETDATA_ML_MODULE_TRAINING, // module
  408. NETDATA_ML_CHART_PRIO_TRAINING_RESULTS, // priority
  409. RH->rrd_update_every, // update_every
  410. RRDSET_TYPE_LINE// chart_type
  411. );
  412. rrdset_flag_set(RS, RRDSET_FLAG_ANOMALY_DETECTION);
  413. Ok = rrddim_add(RS, "ok", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  414. InvalidQueryTimeRange = rrddim_add(RS, "invalid-queries", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  415. NotEnoughCollectedValues = rrddim_add(RS, "not-enough-values", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  416. NullAcquiredDimension = rrddim_add(RS, "null-acquired-dimensions", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  417. ChartUnderReplication = rrddim_add(RS, "chart-under-replication", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
  418. }
  419. rrddim_set_by_pointer(RS, Ok, TS.TrainingResultOk);
  420. rrddim_set_by_pointer(RS, InvalidQueryTimeRange, TS.TrainingResultInvalidQueryTimeRange);
  421. rrddim_set_by_pointer(RS, NotEnoughCollectedValues, TS.TrainingResultNotEnoughCollectedValues);
  422. rrddim_set_by_pointer(RS, NullAcquiredDimension, TS.TrainingResultNullAcquiredDimension);
  423. rrddim_set_by_pointer(RS, ChartUnderReplication, TS.TrainingResultChartUnderReplication);
  424. rrdset_done(RS);
  425. }
  426. }