freebsd_kstat_zfs.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. #include "plugin_freebsd.h"
  3. #include "collectors/proc.plugin/zfs_common.h"
  4. extern struct arcstats arcstats;
  5. unsigned long long zfs_arcstats_shrinkable_cache_size_bytes = 0;
  6. // --------------------------------------------------------------------------------------------------------------------
  7. // kstat.zfs.misc.arcstats
  8. int do_kstat_zfs_misc_arcstats(int update_every, usec_t dt) {
  9. (void)dt;
  10. static int show_zero_charts = -1;
  11. if(unlikely(show_zero_charts == -1))
  12. show_zero_charts = config_get_boolean_ondemand("plugin:freebsd:zfs_arcstats", "show zero charts", CONFIG_BOOLEAN_NO);
  13. unsigned long long l2_size;
  14. size_t uint64_t_size = sizeof(uint64_t);
  15. static struct mibs {
  16. int hits[5];
  17. int misses[5];
  18. int demand_data_hits[5];
  19. int demand_data_misses[5];
  20. int demand_metadata_hits[5];
  21. int demand_metadata_misses[5];
  22. int prefetch_data_hits[5];
  23. int prefetch_data_misses[5];
  24. int prefetch_metadata_hits[5];
  25. int prefetch_metadata_misses[5];
  26. int mru_hits[5];
  27. int mru_ghost_hits[5];
  28. int mfu_hits[5];
  29. int mfu_ghost_hits[5];
  30. int deleted[5];
  31. int mutex_miss[5];
  32. int evict_skip[5];
  33. // int evict_not_enough[5];
  34. // int evict_l2_cached[5];
  35. // int evict_l2_eligible[5];
  36. // int evict_l2_ineligible[5];
  37. // int evict_l2_skip[5];
  38. int hash_elements[5];
  39. int hash_elements_max[5];
  40. int hash_collisions[5];
  41. int hash_chains[5];
  42. int hash_chain_max[5];
  43. int p[5];
  44. int c[5];
  45. int c_min[5];
  46. int c_max[5];
  47. int size[5];
  48. // int hdr_size[5];
  49. // int data_size[5];
  50. // int metadata_size[5];
  51. // int other_size[5];
  52. // int anon_size[5];
  53. // int anon_evictable_data[5];
  54. // int anon_evictable_metadata[5];
  55. int mru_size[5];
  56. // int mru_evictable_data[5];
  57. // int mru_evictable_metadata[5];
  58. // int mru_ghost_size[5];
  59. // int mru_ghost_evictable_data[5];
  60. // int mru_ghost_evictable_metadata[5];
  61. int mfu_size[5];
  62. // int mfu_evictable_data[5];
  63. // int mfu_evictable_metadata[5];
  64. // int mfu_ghost_size[5];
  65. // int mfu_ghost_evictable_data[5];
  66. // int mfu_ghost_evictable_metadata[5];
  67. int l2_hits[5];
  68. int l2_misses[5];
  69. // int l2_feeds[5];
  70. // int l2_rw_clash[5];
  71. int l2_read_bytes[5];
  72. int l2_write_bytes[5];
  73. // int l2_writes_sent[5];
  74. // int l2_writes_done[5];
  75. // int l2_writes_error[5];
  76. // int l2_writes_lock_retry[5];
  77. // int l2_evict_lock_retry[5];
  78. // int l2_evict_reading[5];
  79. // int l2_evict_l1cached[5];
  80. // int l2_free_on_write[5];
  81. // int l2_cdata_free_on_write[5];
  82. // int l2_abort_lowmem[5];
  83. // int l2_cksum_bad[5];
  84. // int l2_io_error[5];
  85. int l2_size[5];
  86. int l2_asize[5];
  87. // int l2_hdr_size[5];
  88. // int l2_compress_successes[5];
  89. // int l2_compress_zeros[5];
  90. // int l2_compress_failures[5];
  91. int memory_throttle_count[5];
  92. // int duplicate_buffers[5];
  93. // int duplicate_buffers_size[5];
  94. // int duplicate_reads[5];
  95. // int memory_direct_count[5];
  96. // int memory_indirect_count[5];
  97. // int arc_no_grow[5];
  98. // int arc_tempreserve[5];
  99. // int arc_loaned_bytes[5];
  100. // int arc_prune[5];
  101. // int arc_meta_used[5];
  102. // int arc_meta_limit[5];
  103. // int arc_meta_max[5];
  104. // int arc_meta_min[5];
  105. // int arc_need_free[5];
  106. // int arc_sys_free[5];
  107. } mibs;
  108. arcstats.l2exist = -1;
  109. if(unlikely(sysctlbyname("kstat.zfs.misc.arcstats.l2_size", &l2_size, &uint64_t_size, NULL, 0)))
  110. return 0;
  111. if(likely(l2_size))
  112. arcstats.l2exist = 1;
  113. else
  114. arcstats.l2exist = 0;
  115. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hits", mibs.hits, arcstats.hits);
  116. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.misses", mibs.misses, arcstats.misses);
  117. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.demand_data_hits", mibs.demand_data_hits, arcstats.demand_data_hits);
  118. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.demand_data_misses", mibs.demand_data_misses, arcstats.demand_data_misses);
  119. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.demand_metadata_hits", mibs.demand_metadata_hits, arcstats.demand_metadata_hits);
  120. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.demand_metadata_misses", mibs.demand_metadata_misses, arcstats.demand_metadata_misses);
  121. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.prefetch_data_hits", mibs.prefetch_data_hits, arcstats.prefetch_data_hits);
  122. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.prefetch_data_misses", mibs.prefetch_data_misses, arcstats.prefetch_data_misses);
  123. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.prefetch_metadata_hits", mibs.prefetch_metadata_hits, arcstats.prefetch_metadata_hits);
  124. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.prefetch_metadata_misses", mibs.prefetch_metadata_misses, arcstats.prefetch_metadata_misses);
  125. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_hits", mibs.mru_hits, arcstats.mru_hits);
  126. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_ghost_hits", mibs.mru_ghost_hits, arcstats.mru_ghost_hits);
  127. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_hits", mibs.mfu_hits, arcstats.mfu_hits);
  128. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_ghost_hits", mibs.mfu_ghost_hits, arcstats.mfu_ghost_hits);
  129. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.deleted", mibs.deleted, arcstats.deleted);
  130. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mutex_miss", mibs.mutex_miss, arcstats.mutex_miss);
  131. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_skip", mibs.evict_skip, arcstats.evict_skip);
  132. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_not_enough", mibs.evict_not_enough, arcstats.evict_not_enough);
  133. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_l2_cached", mibs.evict_l2_cached, arcstats.evict_l2_cached);
  134. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_l2_eligible", mibs.evict_l2_eligible, arcstats.evict_l2_eligible);
  135. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_l2_ineligible", mibs.evict_l2_ineligible, arcstats.evict_l2_ineligible);
  136. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.evict_l2_skip", mibs.evict_l2_skip, arcstats.evict_l2_skip);
  137. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hash_elements", mibs.hash_elements, arcstats.hash_elements);
  138. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hash_elements_max", mibs.hash_elements_max, arcstats.hash_elements_max);
  139. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hash_collisions", mibs.hash_collisions, arcstats.hash_collisions);
  140. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hash_chains", mibs.hash_chains, arcstats.hash_chains);
  141. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hash_chain_max", mibs.hash_chain_max, arcstats.hash_chain_max);
  142. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.p", mibs.p, arcstats.p);
  143. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.c", mibs.c, arcstats.c);
  144. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.c_min", mibs.c_min, arcstats.c_min);
  145. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.c_max", mibs.c_max, arcstats.c_max);
  146. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.size", mibs.size, arcstats.size);
  147. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.hdr_size", mibs.hdr_size, arcstats.hdr_size);
  148. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.data_size", mibs.data_size, arcstats.data_size);
  149. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.metadata_size", mibs.metadata_size, arcstats.metadata_size);
  150. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.other_size", mibs.other_size, arcstats.other_size);
  151. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.anon_size", mibs.anon_size, arcstats.anon_size);
  152. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.anon_evictable_data", mibs.anon_evictable_data, arcstats.anon_evictable_data);
  153. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.anon_evictable_metadata", mibs.anon_evictable_metadata, arcstats.anon_evictable_metadata);
  154. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_size", mibs.mru_size, arcstats.mru_size);
  155. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_evictable_data", mibs.mru_evictable_data, arcstats.mru_evictable_data);
  156. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_evictable_metadata", mibs.mru_evictable_metadata, arcstats.mru_evictable_metadata);
  157. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_ghost_size", mibs.mru_ghost_size, arcstats.mru_ghost_size);
  158. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_ghost_evictable_data", mibs.mru_ghost_evictable_data, arcstats.mru_ghost_evictable_data);
  159. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mru_ghost_evictable_metadata", mibs.mru_ghost_evictable_metadata, arcstats.mru_ghost_evictable_metadata);
  160. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_size", mibs.mfu_size, arcstats.mfu_size);
  161. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_evictable_data", mibs.mfu_evictable_data, arcstats.mfu_evictable_data);
  162. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_evictable_metadata", mibs.mfu_evictable_metadata, arcstats.mfu_evictable_metadata);
  163. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_ghost_size", mibs.mfu_ghost_size, arcstats.mfu_ghost_size);
  164. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_ghost_evictable_data", mibs.mfu_ghost_evictable_data, arcstats.mfu_ghost_evictable_data);
  165. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.mfu_ghost_evictable_metadata", mibs.mfu_ghost_evictable_metadata, arcstats.mfu_ghost_evictable_metadata);
  166. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_hits", mibs.l2_hits, arcstats.l2_hits);
  167. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_misses", mibs.l2_misses, arcstats.l2_misses);
  168. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_feeds", mibs.l2_feeds, arcstats.l2_feeds);
  169. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_rw_clash", mibs.l2_rw_clash, arcstats.l2_rw_clash);
  170. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_read_bytes", mibs.l2_read_bytes, arcstats.l2_read_bytes);
  171. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_write_bytes", mibs.l2_write_bytes, arcstats.l2_write_bytes);
  172. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_writes_sent", mibs.l2_writes_sent, arcstats.l2_writes_sent);
  173. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_writes_done", mibs.l2_writes_done, arcstats.l2_writes_done);
  174. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_writes_error", mibs.l2_writes_error, arcstats.l2_writes_error);
  175. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_writes_lock_retry", mibs.l2_writes_lock_retry, arcstats.l2_writes_lock_retry);
  176. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_evict_lock_retry", mibs.l2_evict_lock_retry, arcstats.l2_evict_lock_retry);
  177. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_evict_reading", mibs.l2_evict_reading, arcstats.l2_evict_reading);
  178. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_evict_l1cached", mibs.l2_evict_l1cached, arcstats.l2_evict_l1cached);
  179. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_free_on_write", mibs.l2_free_on_write, arcstats.l2_free_on_write);
  180. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_cdata_free_on_write", mibs.l2_cdata_free_on_write, arcstats.l2_cdata_free_on_write);
  181. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_abort_lowmem", mibs.l2_abort_lowmem, arcstats.l2_abort_lowmem);
  182. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_cksum_bad", mibs.l2_cksum_bad, arcstats.l2_cksum_bad);
  183. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_io_error", mibs.l2_io_error, arcstats.l2_io_error);
  184. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_size", mibs.l2_size, arcstats.l2_size);
  185. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_asize", mibs.l2_asize, arcstats.l2_asize);
  186. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_hdr_size", mibs.l2_hdr_size, arcstats.l2_hdr_size);
  187. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_compress_successes", mibs.l2_compress_successes, arcstats.l2_compress_successes);
  188. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_compress_zeros", mibs.l2_compress_zeros, arcstats.l2_compress_zeros);
  189. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.l2_compress_failures", mibs.l2_compress_failures, arcstats.l2_compress_failures);
  190. GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.memory_throttle_count", mibs.memory_throttle_count, arcstats.memory_throttle_count);
  191. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.duplicate_buffers", mibs.duplicate_buffers, arcstats.duplicate_buffers);
  192. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.duplicate_buffers_size", mibs.duplicate_buffers_size, arcstats.duplicate_buffers_size);
  193. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.duplicate_reads", mibs.duplicate_reads, arcstats.duplicate_reads);
  194. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.memory_direct_count", mibs.memory_direct_count, arcstats.memory_direct_count);
  195. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.memory_indirect_count", mibs.memory_indirect_count, arcstats.memory_indirect_count);
  196. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_no_grow", mibs.arc_no_grow, arcstats.arc_no_grow);
  197. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_tempreserve", mibs.arc_tempreserve, arcstats.arc_tempreserve);
  198. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_loaned_bytes", mibs.arc_loaned_bytes, arcstats.arc_loaned_bytes);
  199. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_prune", mibs.arc_prune, arcstats.arc_prune);
  200. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_meta_used", mibs.arc_meta_used, arcstats.arc_meta_used);
  201. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_meta_limit", mibs.arc_meta_limit, arcstats.arc_meta_limit);
  202. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_meta_max", mibs.arc_meta_max, arcstats.arc_meta_max);
  203. // not used: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_meta_min", mibs.arc_meta_min, arcstats.arc_meta_min);
  204. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_need_free", mibs.arc_need_free, arcstats.arc_need_free);
  205. // missing mib: GETSYSCTL_SIMPLE("kstat.zfs.misc.arcstats.arc_sys_free", mibs.arc_sys_free, arcstats.arc_sys_free);
  206. if (arcstats.size > arcstats.c_min) {
  207. zfs_arcstats_shrinkable_cache_size_bytes = arcstats.size - arcstats.c_min;
  208. } else {
  209. zfs_arcstats_shrinkable_cache_size_bytes = 0;
  210. }
  211. generate_charts_arcstats("freebsd.plugin", "zfs", show_zero_charts, update_every);
  212. generate_charts_arc_summary("freebsd.plugin", "zfs", show_zero_charts, update_every);
  213. return 0;
  214. }
  215. // --------------------------------------------------------------------------------------------------------------------
  216. // kstat.zfs.misc.zio_trim
  217. int do_kstat_zfs_misc_zio_trim(int update_every, usec_t dt) {
  218. (void)dt;
  219. static int mib_bytes[5] = {0, 0, 0, 0, 0}, mib_success[5] = {0, 0, 0, 0, 0},
  220. mib_failed[5] = {0, 0, 0, 0, 0}, mib_unsupported[5] = {0, 0, 0, 0, 0};
  221. uint64_t bytes, success, failed, unsupported;
  222. if (unlikely(GETSYSCTL_SIMPLE("kstat.zfs.misc.zio_trim.bytes", mib_bytes, bytes) ||
  223. GETSYSCTL_SIMPLE("kstat.zfs.misc.zio_trim.success", mib_success, success) ||
  224. GETSYSCTL_SIMPLE("kstat.zfs.misc.zio_trim.failed", mib_failed, failed) ||
  225. GETSYSCTL_SIMPLE("kstat.zfs.misc.zio_trim.unsupported", mib_unsupported, unsupported))) {
  226. error("DISABLED: zfs.trim_bytes chart");
  227. error("DISABLED: zfs.trim_success chart");
  228. error("DISABLED: kstat.zfs.misc.zio_trim module");
  229. return 1;
  230. } else {
  231. // --------------------------------------------------------------------
  232. static RRDSET *st_bytes = NULL;
  233. static RRDDIM *rd_bytes = NULL;
  234. if (unlikely(!st_bytes)) {
  235. st_bytes = rrdset_create_localhost(
  236. "zfs",
  237. "trim_bytes",
  238. NULL,
  239. "trim",
  240. NULL,
  241. "Successfully TRIMmed bytes",
  242. "bytes",
  243. "freebsd.plugin",
  244. "zfs",
  245. 2320,
  246. update_every,
  247. RRDSET_TYPE_LINE
  248. );
  249. rd_bytes = rrddim_add(st_bytes, "TRIMmed", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
  250. }
  251. else rrdset_next(st_bytes);
  252. rrddim_set_by_pointer(st_bytes, rd_bytes, bytes);
  253. rrdset_done(st_bytes);
  254. // --------------------------------------------------------------------
  255. static RRDSET *st_requests = NULL;
  256. static RRDDIM *rd_successful = NULL, *rd_failed = NULL, *rd_unsupported = NULL;
  257. if (unlikely(!st_requests)) {
  258. st_requests = rrdset_create_localhost(
  259. "zfs",
  260. "trim_requests",
  261. NULL,
  262. "trim",
  263. NULL,
  264. "TRIM requests",
  265. "requests",
  266. "freebsd.plugin",
  267. "zfs",
  268. 2321,
  269. update_every,
  270. RRDSET_TYPE_STACKED
  271. );
  272. rd_successful = rrddim_add(st_requests, "successful", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
  273. rd_failed = rrddim_add(st_requests, "failed", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
  274. rd_unsupported = rrddim_add(st_requests, "unsupported", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
  275. }
  276. else rrdset_next(st_requests);
  277. rrddim_set_by_pointer(st_requests, rd_successful, success);
  278. rrddim_set_by_pointer(st_requests, rd_failed, failed);
  279. rrddim_set_by_pointer(st_requests, rd_unsupported, unsupported);
  280. rrdset_done(st_requests);
  281. }
  282. return 0;
  283. }