| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #include "windows_plugin.h" |
| 4 | #include "windows-internals.h" |
| 5 | |
| 6 | static void netdata_ad_address_book_ambiguous_name_resolution( |
| 7 | PERF_DATA_BLOCK *pDataBlock, |
| 8 | PERF_OBJECT_TYPE *pObjectType, |
| 9 | int update_every) |
| 10 | { |
| 11 | static COUNTER_DATA addressBookANRPerSec = {.key = "AB ANR/sec"}; |
| 12 | static RRDSET *st_address_book_ambiguous_name_resolution = NULL; |
| 13 | static RRDDIM *rd_address_book_ambiguous_name_resolution = NULL; |
| 14 | |
| 15 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookANRPerSec)) |
| 16 | return; |
| 17 | |
| 18 | if (unlikely(!st_address_book_ambiguous_name_resolution)) { |
| 19 | st_address_book_ambiguous_name_resolution = rrdset_create_localhost( |
| 20 | "ad", |
| 21 | "address_book_ambiguous_name_resolution", |
| 22 | NULL, |
| 23 | "address_book", |
| 24 | "ad.address_book_ambiguous_name_resolution", |
| 25 | "Address book ambiguous name resolution", |
| 26 | "operations/s", |
| 27 | PLUGIN_WINDOWS_NAME, |
| 28 | "PerflibAD", |
| 29 | PRIO_AD_ADDRESS_BOOK_AMBIGUOUS_NAME_RESOLUTION, |
| 30 | update_every, |
| 31 | RRDSET_TYPE_LINE); |
| 32 | |
| 33 | rd_address_book_ambiguous_name_resolution = rrddim_add( |
| 34 | st_address_book_ambiguous_name_resolution, |
| 35 | "ambiguous_name_resolution", |
| 36 | NULL, |
| 37 | 1, |
| 38 | 1, |
| 39 | RRD_ALGORITHM_INCREMENTAL); |
| 40 | } |
| 41 | |
| 42 | rrddim_set_by_pointer( |
| 43 | st_address_book_ambiguous_name_resolution, |
| 44 | rd_address_book_ambiguous_name_resolution, |
| 45 | (collected_number)addressBookANRPerSec.current.Data); |
| 46 | rrdset_done(st_address_book_ambiguous_name_resolution); |
| 47 | } |
| 48 | |
| 49 | static void netdata_ad_address_book_browse(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 50 | { |
| 51 | static COUNTER_DATA addressBookBrowsesPerSec = {.key = "AB Browses/sec"}; |
| 52 | static RRDSET *st_address_book_browse = NULL; |
| 53 | static RRDDIM *rd_address_book_browse = NULL; |
| 54 | |
| 55 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookBrowsesPerSec)) |
| 56 | return; |
| 57 | |
| 58 | if (unlikely(!st_address_book_browse)) { |
| 59 | st_address_book_browse = rrdset_create_localhost( |
| 60 | "ad", |
| 61 | "address_book_browse", |
| 62 | NULL, |
| 63 | "address_book", |
| 64 | "ad.address_book_browse", |
| 65 | "Address book browse operations", |
| 66 | "operations/s", |
| 67 | PLUGIN_WINDOWS_NAME, |
| 68 | "PerflibAD", |
| 69 | PRIO_AD_ADDRESS_BOOK_BROWSE, |
| 70 | update_every, |
| 71 | RRDSET_TYPE_LINE); |
| 72 | |
| 73 | rd_address_book_browse = rrddim_add(st_address_book_browse, "browse", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 74 | } |
| 75 | |
| 76 | rrddim_set_by_pointer( |
| 77 | st_address_book_browse, rd_address_book_browse, (collected_number)addressBookBrowsesPerSec.current.Data); |
| 78 | rrdset_done(st_address_book_browse); |
| 79 | } |
| 80 | |
| 81 | static void netdata_ad_address_book_find(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 82 | { |
| 83 | static COUNTER_DATA addressBookMatchesPerSec = {.key = "AB Matches/sec"}; |
| 84 | static RRDSET *st_address_book_find = NULL; |
| 85 | static RRDDIM *rd_address_book_find = NULL; |
| 86 | |
| 87 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookMatchesPerSec)) |
| 88 | return; |
| 89 | |
| 90 | if (unlikely(!st_address_book_find)) { |
| 91 | st_address_book_find = rrdset_create_localhost( |
| 92 | "ad", |
| 93 | "address_book_find", |
| 94 | NULL, |
| 95 | "address_book", |
| 96 | "ad.address_book_find", |
| 97 | "Address book matches", |
| 98 | "operations/s", |
| 99 | PLUGIN_WINDOWS_NAME, |
| 100 | "PerflibAD", |
| 101 | PRIO_AD_ADDRESS_BOOK_FIND, |
| 102 | update_every, |
| 103 | RRDSET_TYPE_LINE); |
| 104 | |
| 105 | rd_address_book_find = rrddim_add(st_address_book_find, "find", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 106 | } |
| 107 | |
| 108 | rrddim_set_by_pointer( |
| 109 | st_address_book_find, rd_address_book_find, (collected_number)addressBookMatchesPerSec.current.Data); |
| 110 | rrdset_done(st_address_book_find); |
| 111 | } |
| 112 | |
| 113 | static void |
| 114 | netdata_ad_address_book_property_read(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 115 | { |
| 116 | static COUNTER_DATA addressBookPropertyReadsPerSec = {.key = "AB Property Reads/sec"}; |
| 117 | static RRDSET *st_address_book_property_read = NULL; |
| 118 | static RRDDIM *rd_address_book_property_read = NULL; |
| 119 | |
| 120 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookPropertyReadsPerSec)) |
| 121 | return; |
| 122 | |
| 123 | if (unlikely(!st_address_book_property_read)) { |
| 124 | st_address_book_property_read = rrdset_create_localhost( |
| 125 | "ad", |
| 126 | "address_book_property_read", |
| 127 | NULL, |
| 128 | "address_book", |
| 129 | "ad.address_book_property_read", |
| 130 | "Address book property reads", |
| 131 | "operations/s", |
| 132 | PLUGIN_WINDOWS_NAME, |
| 133 | "PerflibAD", |
| 134 | PRIO_AD_ADDRESS_BOOK_PROPERTY_READ, |
| 135 | update_every, |
| 136 | RRDSET_TYPE_LINE); |
| 137 | |
| 138 | rd_address_book_property_read = |
| 139 | rrddim_add(st_address_book_property_read, "property_read", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 140 | } |
| 141 | |
| 142 | rrddim_set_by_pointer( |
| 143 | st_address_book_property_read, |
| 144 | rd_address_book_property_read, |
| 145 | (collected_number)addressBookPropertyReadsPerSec.current.Data); |
| 146 | rrdset_done(st_address_book_property_read); |
| 147 | } |
| 148 | |
| 149 | static void netdata_ad_address_book_search(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 150 | { |
| 151 | static COUNTER_DATA addressBookSearchesPerSec = {.key = "AB Searches/sec"}; |
| 152 | static RRDSET *st_address_book_search = NULL; |
| 153 | static RRDDIM *rd_address_book_search = NULL; |
| 154 | |
| 155 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookSearchesPerSec)) |
| 156 | return; |
| 157 | |
| 158 | if (unlikely(!st_address_book_search)) { |
| 159 | st_address_book_search = rrdset_create_localhost( |
| 160 | "ad", |
| 161 | "address_book_search", |
| 162 | NULL, |
| 163 | "address_book", |
| 164 | "ad.address_book_search", |
| 165 | "Address book searches", |
| 166 | "operations/s", |
| 167 | PLUGIN_WINDOWS_NAME, |
| 168 | "PerflibAD", |
| 169 | PRIO_AD_ADDRESS_BOOK_SEARCH, |
| 170 | update_every, |
| 171 | RRDSET_TYPE_LINE); |
| 172 | |
| 173 | rd_address_book_search = rrddim_add(st_address_book_search, "search", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 174 | } |
| 175 | |
| 176 | rrddim_set_by_pointer( |
| 177 | st_address_book_search, rd_address_book_search, (collected_number)addressBookSearchesPerSec.current.Data); |
| 178 | rrdset_done(st_address_book_search); |
| 179 | } |
| 180 | |
| 181 | static void |
| 182 | netdata_ad_address_book_proxy_search(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 183 | { |
| 184 | static COUNTER_DATA addressBookProxyLookupsPerSec = {.key = "AB Proxy Lookups/sec"}; |
| 185 | static RRDSET *st_address_book_proxy_search = NULL; |
| 186 | static RRDDIM *rd_address_book_proxy_search = NULL; |
| 187 | |
| 188 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookProxyLookupsPerSec)) |
| 189 | return; |
| 190 | |
| 191 | if (unlikely(!st_address_book_proxy_search)) { |
| 192 | st_address_book_proxy_search = rrdset_create_localhost( |
| 193 | "ad", |
| 194 | "address_book_proxy_search", |
| 195 | NULL, |
| 196 | "address_book", |
| 197 | "ad.address_book_proxy_search", |
| 198 | "Address book proxy searches", |
| 199 | "operations/s", |
| 200 | PLUGIN_WINDOWS_NAME, |
| 201 | "PerflibAD", |
| 202 | PRIO_AD_ADDRESS_BOOK_PROXY_SEARCH, |
| 203 | update_every, |
| 204 | RRDSET_TYPE_LINE); |
| 205 | |
| 206 | rd_address_book_proxy_search = |
| 207 | rrddim_add(st_address_book_proxy_search, "proxy_search", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 208 | } |
| 209 | |
| 210 | rrddim_set_by_pointer( |
| 211 | st_address_book_proxy_search, |
| 212 | rd_address_book_proxy_search, |
| 213 | (collected_number)addressBookProxyLookupsPerSec.current.Data); |
| 214 | rrdset_done(st_address_book_proxy_search); |
| 215 | } |
| 216 | |
| 217 | static void |
| 218 | netdata_ad_address_book_client_sessions(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 219 | { |
| 220 | static COUNTER_DATA addressBookClientSessions = {.key = "AB Client Sessions"}; |
| 221 | static RRDSET *st_address_book_client_sessions = NULL; |
| 222 | static RRDDIM *rd_address_book_client_sessions = NULL; |
| 223 | |
| 224 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &addressBookClientSessions)) |
| 225 | return; |
| 226 | |
| 227 | if (unlikely(!st_address_book_client_sessions)) { |
| 228 | st_address_book_client_sessions = rrdset_create_localhost( |
| 229 | "ad", |
| 230 | "address_book_client_sessions", |
| 231 | NULL, |
| 232 | "address_book", |
| 233 | "ad.address_book_client_sessions", |
| 234 | "Address book client sessions", |
| 235 | "sessions", |
| 236 | PLUGIN_WINDOWS_NAME, |
| 237 | "PerflibAD", |
| 238 | PRIO_AD_ADDRESS_BOOK_CLIENT_SESSIONS, |
| 239 | update_every, |
| 240 | RRDSET_TYPE_LINE); |
| 241 | |
| 242 | rd_address_book_client_sessions = |
| 243 | rrddim_add(st_address_book_client_sessions, "sessions", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 244 | } |
| 245 | |
| 246 | rrddim_set_by_pointer( |
| 247 | st_address_book_client_sessions, |
| 248 | rd_address_book_client_sessions, |
| 249 | (collected_number)addressBookClientSessions.current.Data); |
| 250 | rrdset_done(st_address_book_client_sessions); |
| 251 | } |
| 252 | |
| 253 | static void netdata_ad_address_book(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 254 | { |
| 255 | netdata_ad_address_book_ambiguous_name_resolution(pDataBlock, pObjectType, update_every); |
| 256 | netdata_ad_address_book_browse(pDataBlock, pObjectType, update_every); |
| 257 | netdata_ad_address_book_find(pDataBlock, pObjectType, update_every); |
| 258 | netdata_ad_address_book_property_read(pDataBlock, pObjectType, update_every); |
| 259 | netdata_ad_address_book_search(pDataBlock, pObjectType, update_every); |
| 260 | netdata_ad_address_book_proxy_search(pDataBlock, pObjectType, update_every); |
| 261 | netdata_ad_address_book_client_sessions(pDataBlock, pObjectType, update_every); |
| 262 | } |
| 263 | |
| 264 | static void |
| 265 | netdata_ad_approximate_highest_dnt(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 266 | { |
| 267 | static COUNTER_DATA approximateHighestDNT = {.key = "Approximate highest DNT"}; |
| 268 | |
| 269 | static RRDSET *st_approximate_highest_dnt = NULL; |
| 270 | static RRDDIM *rd_approximate_highest_dnt = NULL; |
| 271 | |
| 272 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &approximateHighestDNT)) |
| 273 | return; |
| 274 | |
| 275 | if (unlikely(!st_approximate_highest_dnt)) { |
| 276 | st_approximate_highest_dnt = rrdset_create_localhost( |
| 277 | "ad", |
| 278 | "approximate_highest_dnt", |
| 279 | NULL, |
| 280 | "database", |
| 281 | "ad.approximate_highest_dnt", |
| 282 | "Approximate highest distinguished name tag", |
| 283 | "dnt", |
| 284 | PLUGIN_WINDOWS_NAME, |
| 285 | "PerflibAD", |
| 286 | PRIO_AD_APPROXIMATE_HIGHEST_DNT, |
| 287 | update_every, |
| 288 | RRDSET_TYPE_LINE); |
| 289 | |
| 290 | rd_approximate_highest_dnt = rrddim_add(st_approximate_highest_dnt, "dnt", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 291 | } |
| 292 | |
| 293 | rrddim_set_by_pointer( |
| 294 | st_approximate_highest_dnt, rd_approximate_highest_dnt, (collected_number)approximateHighestDNT.current.Data); |
| 295 | rrdset_done(st_approximate_highest_dnt); |
| 296 | } |
| 297 | |
| 298 | static void netdata_ad_directory(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 299 | { |
| 300 | static COUNTER_DATA directoryPercReadsFromDCA = {.key = "DS % Reads from DRA"}; |
| 301 | static COUNTER_DATA directoryPercReadsFromKCC = {.key = "DS % Reads from KCC"}; |
| 302 | static COUNTER_DATA directoryPercReadsFromLSA = {.key = "DS % Reads from LSA"}; |
| 303 | static COUNTER_DATA directoryPercReadsFromNSPI = {.key = "DS % Reads from NSPI"}; |
| 304 | static COUNTER_DATA directoryPercReadsFromNTDSAPI = {.key = "DS % Reads from NTDSAPI"}; |
| 305 | static COUNTER_DATA directoryPercReadsFromSAM = {.key = "DS % Reads from SAM"}; |
| 306 | static COUNTER_DATA directoryPercReadsOther = {.key = "DS % Reads Other"}; |
| 307 | |
| 308 | static COUNTER_DATA directoryPercSearchesFromDCA = {.key = "DS % Searches from DRA"}; |
| 309 | static COUNTER_DATA directoryPercSearchesFromKCC = {.key = "DS % Searches from KCC"}; |
| 310 | static COUNTER_DATA directoryPercSearchesFromLSA = {.key = "DS % Searches from LSA"}; |
| 311 | static COUNTER_DATA directoryPercSearchesFromNSPI = {.key = "DS % Searches from NSPI"}; |
| 312 | static COUNTER_DATA directoryPercSearchesFromNTDSAPI = {.key = "DS % Searches from NTDSAPI"}; |
| 313 | static COUNTER_DATA directoryPercSearchesFromSAM = {.key = "DS % Searches from SAM"}; |
| 314 | static COUNTER_DATA directoryPercSearchesFromLDAP = {.key = "DS % Searches from LDAP"}; |
| 315 | static COUNTER_DATA directoryPercSearchesOther = {.key = "DS % Searches Other"}; |
| 316 | |
| 317 | static COUNTER_DATA directoryPercWritesFromDCA = {.key = "DS % Writes from DRA"}; |
| 318 | static COUNTER_DATA directoryPercWritesFromKCC = {.key = "DS % Writes from KCC"}; |
| 319 | static COUNTER_DATA directoryPercWritesFromLSA = {.key = "DS % Writes from LSA"}; |
| 320 | static COUNTER_DATA directoryPercWritesFromNSPI = {.key = "DS % Writes from NSPI"}; |
| 321 | static COUNTER_DATA directoryPercWritesFromNTDSAPI = {.key = "DS % Writes from NTDSAPI"}; |
| 322 | static COUNTER_DATA directoryPercWritesFromSAM = {.key = "DS % Writes from SAM"}; |
| 323 | static COUNTER_DATA directoryPercWritesFromLDAP = {.key = "DS % Writes from LDAP"}; |
| 324 | static COUNTER_DATA directoryPercWritesOther = {.key = "DS % Writes Other"}; |
| 325 | |
| 326 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromDCA); |
| 327 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromKCC); |
| 328 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromLSA); |
| 329 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromNSPI); |
| 330 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromNTDSAPI); |
| 331 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsFromSAM); |
| 332 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercReadsOther); |
| 333 | |
| 334 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromDCA); |
| 335 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromKCC); |
| 336 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromLSA); |
| 337 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromNSPI); |
| 338 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromNTDSAPI); |
| 339 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromSAM); |
| 340 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesFromLDAP); |
| 341 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercSearchesOther); |
| 342 | |
| 343 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromDCA); |
| 344 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromKCC); |
| 345 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromLSA); |
| 346 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromNSPI); |
| 347 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromNTDSAPI); |
| 348 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromSAM); |
| 349 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesFromLDAP); |
| 350 | perflibGetObjectCounter(pDataBlock, pObjectType, &directoryPercWritesOther); |
| 351 | |
| 352 | static RRDSET *st_directory_operation_total = NULL; |
| 353 | static RRDDIM *rd_directory_operation_total_read = NULL; |
| 354 | static RRDDIM *rd_directory_operation_total_write = NULL; |
| 355 | static RRDDIM *rd_directory_operation_total_search = NULL; |
| 356 | |
| 357 | if (unlikely(!st_directory_operation_total)) { |
| 358 | st_directory_operation_total = rrdset_create_localhost( |
| 359 | "ad", |
| 360 | "directory_operations_read", |
| 361 | NULL, |
| 362 | "database", |
| 363 | "ad.directory_operations", |
| 364 | "AD directory operations", |
| 365 | "operations/s", |
| 366 | PLUGIN_WINDOWS_NAME, |
| 367 | "PerflibAD", |
| 368 | PRIO_AD_DIROPERATIONS_TOTAL, |
| 369 | update_every, |
| 370 | RRDSET_TYPE_LINE); |
| 371 | |
| 372 | rd_directory_operation_total_read = |
| 373 | rrddim_add(st_directory_operation_total, "read", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 374 | |
| 375 | rd_directory_operation_total_write = |
| 376 | rrddim_add(st_directory_operation_total, "write", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 377 | |
| 378 | rd_directory_operation_total_search = |
| 379 | rrddim_add(st_directory_operation_total, "search", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 380 | } |
| 381 | collected_number readValue = directoryPercReadsFromDCA.current.Data + directoryPercReadsFromKCC.current.Data + |
| 382 | directoryPercReadsFromLSA.current.Data + directoryPercReadsFromNSPI.current.Data + |
| 383 | directoryPercReadsFromNTDSAPI.current.Data + directoryPercReadsFromSAM.current.Data + |
| 384 | directoryPercReadsOther.current.Data; |
| 385 | |
| 386 | collected_number writeValue = directoryPercWritesFromDCA.current.Data + directoryPercWritesFromKCC.current.Data + |
| 387 | directoryPercWritesFromLSA.current.Data + directoryPercWritesFromNSPI.current.Data + |
| 388 | directoryPercWritesFromNTDSAPI.current.Data + |
| 389 | directoryPercWritesFromSAM.current.Data + directoryPercWritesFromLDAP.current.Data + |
| 390 | directoryPercWritesOther.current.Data; |
| 391 | |
| 392 | collected_number searchValue = |
| 393 | directoryPercSearchesFromDCA.current.Data + directoryPercSearchesFromKCC.current.Data + |
| 394 | directoryPercSearchesFromLSA.current.Data + directoryPercSearchesFromNSPI.current.Data + |
| 395 | directoryPercSearchesFromNTDSAPI.current.Data + directoryPercSearchesFromSAM.current.Data + |
| 396 | directoryPercSearchesFromLDAP.current.Data + directoryPercSearchesOther.current.Data; |
| 397 | |
| 398 | rrddim_set_by_pointer(st_directory_operation_total, rd_directory_operation_total_read, readValue); |
| 399 | |
| 400 | rrddim_set_by_pointer(st_directory_operation_total, rd_directory_operation_total_write, writeValue); |
| 401 | |
| 402 | rrddim_set_by_pointer(st_directory_operation_total, rd_directory_operation_total_search, searchValue); |
| 403 | |
| 404 | rrdset_done(st_directory_operation_total); |
| 405 | } |
| 406 | |
| 407 | static void netdata_ad_search_scope_base(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 408 | { |
| 409 | static COUNTER_DATA baseSearchesPerSec = {.key = "Base searches/sec"}; |
| 410 | static RRDSET *st_search_scope_base = NULL; |
| 411 | static RRDDIM *rd_search_scope_base = NULL; |
| 412 | |
| 413 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &baseSearchesPerSec)) |
| 414 | return; |
| 415 | |
| 416 | if (unlikely(!st_search_scope_base)) { |
| 417 | st_search_scope_base = rrdset_create_localhost( |
| 418 | "ad", |
| 419 | "searches_base", |
| 420 | NULL, |
| 421 | "search", |
| 422 | "ad.searches_base", |
| 423 | "Directory base searches", |
| 424 | "searches/s", |
| 425 | PLUGIN_WINDOWS_NAME, |
| 426 | "PerflibAD", |
| 427 | PRIO_AD_SEARCHES_SCOPE_BASE, |
| 428 | update_every, |
| 429 | RRDSET_TYPE_LINE); |
| 430 | |
| 431 | rd_search_scope_base = rrddim_add(st_search_scope_base, "base", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 432 | } |
| 433 | |
| 434 | rrddim_set_by_pointer( |
| 435 | st_search_scope_base, rd_search_scope_base, (collected_number)baseSearchesPerSec.current.Data); |
| 436 | rrdset_done(st_search_scope_base); |
| 437 | } |
| 438 | |
| 439 | static void |
| 440 | netdata_ad_search_scope_subtree(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 441 | { |
| 442 | static COUNTER_DATA subtreeSearchesPerSec = {.key = "Subtree searches/sec"}; |
| 443 | static RRDSET *st_search_scope_subtree = NULL; |
| 444 | static RRDDIM *rd_search_scope_subtree = NULL; |
| 445 | |
| 446 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &subtreeSearchesPerSec)) |
| 447 | return; |
| 448 | |
| 449 | if (unlikely(!st_search_scope_subtree)) { |
| 450 | st_search_scope_subtree = rrdset_create_localhost( |
| 451 | "ad", |
| 452 | "searches_subtree", |
| 453 | NULL, |
| 454 | "search", |
| 455 | "ad.searches_subtree", |
| 456 | "Directory subtree searches", |
| 457 | "searches/s", |
| 458 | PLUGIN_WINDOWS_NAME, |
| 459 | "PerflibAD", |
| 460 | PRIO_AD_SEARCHES_SCOPE_SUBTREE, |
| 461 | update_every, |
| 462 | RRDSET_TYPE_LINE); |
| 463 | |
| 464 | rd_search_scope_subtree = rrddim_add(st_search_scope_subtree, "subtree", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 465 | } |
| 466 | |
| 467 | rrddim_set_by_pointer( |
| 468 | st_search_scope_subtree, rd_search_scope_subtree, (collected_number)subtreeSearchesPerSec.current.Data); |
| 469 | rrdset_done(st_search_scope_subtree); |
| 470 | } |
| 471 | |
| 472 | static void |
| 473 | netdata_ad_search_scope_one_level(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 474 | { |
| 475 | static COUNTER_DATA oneLevelSearchesPerSec = {.key = "Onelevel searches/sec"}; |
| 476 | static RRDSET *st_search_scope_one_level = NULL; |
| 477 | static RRDDIM *rd_search_scope_one_level = NULL; |
| 478 | |
| 479 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &oneLevelSearchesPerSec)) |
| 480 | return; |
| 481 | |
| 482 | if (unlikely(!st_search_scope_one_level)) { |
| 483 | st_search_scope_one_level = rrdset_create_localhost( |
| 484 | "ad", |
| 485 | "searches_one_level", |
| 486 | NULL, |
| 487 | "search", |
| 488 | "ad.searches_one_level", |
| 489 | "Directory one-level searches", |
| 490 | "searches/s", |
| 491 | PLUGIN_WINDOWS_NAME, |
| 492 | "PerflibAD", |
| 493 | PRIO_AD_SEARCHES_SCOPE_ONE_LEVEL, |
| 494 | update_every, |
| 495 | RRDSET_TYPE_LINE); |
| 496 | |
| 497 | rd_search_scope_one_level = |
| 498 | rrddim_add(st_search_scope_one_level, "one_level", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 499 | } |
| 500 | |
| 501 | rrddim_set_by_pointer( |
| 502 | st_search_scope_one_level, rd_search_scope_one_level, (collected_number)oneLevelSearchesPerSec.current.Data); |
| 503 | rrdset_done(st_search_scope_one_level); |
| 504 | } |
| 505 | |
| 506 | static void netdata_ad_search_scope(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 507 | { |
| 508 | netdata_ad_search_scope_base(pDataBlock, pObjectType, update_every); |
| 509 | netdata_ad_search_scope_subtree(pDataBlock, pObjectType, update_every); |
| 510 | netdata_ad_search_scope_one_level(pDataBlock, pObjectType, update_every); |
| 511 | } |
| 512 | |
| 513 | static void netdata_ad_cache_lookups(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 514 | { |
| 515 | static COUNTER_DATA nameCacheLookupsTotal = {.key = "DS Name Cache hit rate"}; |
| 516 | |
| 517 | static RRDSET *st_name_cache_lookups_total = NULL; |
| 518 | static RRDDIM *rd_name_cache_lookups_total = NULL; |
| 519 | |
| 520 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &nameCacheLookupsTotal)) { |
| 521 | return; |
| 522 | } |
| 523 | |
| 524 | if (unlikely(!st_name_cache_lookups_total)) { |
| 525 | st_name_cache_lookups_total = rrdset_create_localhost( |
| 526 | "ad", |
| 527 | "name_cache_lookups", |
| 528 | NULL, |
| 529 | "database", |
| 530 | "ad.name_cache_lookups", |
| 531 | "Name cache lookups", |
| 532 | "lookups/s", |
| 533 | PLUGIN_WINDOWS_NAME, |
| 534 | "PerflibAD", |
| 535 | PRIO_AD_CACHE_LOOKUP_TOTAL, |
| 536 | update_every, |
| 537 | RRDSET_TYPE_LINE); |
| 538 | |
| 539 | rd_name_cache_lookups_total = |
| 540 | rrddim_add(st_name_cache_lookups_total, "lookups", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 541 | } |
| 542 | |
| 543 | rrddim_set_by_pointer( |
| 544 | st_name_cache_lookups_total, rd_name_cache_lookups_total, (collected_number)nameCacheLookupsTotal.current.Data); |
| 545 | rrdset_done(st_name_cache_lookups_total); |
| 546 | } |
| 547 | |
| 548 | static void netdata_ad_cache_hits(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 549 | { |
| 550 | static COUNTER_DATA nameCacheHitsTotal = {.key = "DS Name Cache hit rate,secondvalue"}; |
| 551 | |
| 552 | static RRDSET *st_name_cache_hits_total = NULL; |
| 553 | static RRDDIM *rd_name_cache_hits_total = NULL; |
| 554 | |
| 555 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &nameCacheHitsTotal)) { |
| 556 | return; |
| 557 | } |
| 558 | |
| 559 | if (unlikely(!st_name_cache_hits_total)) { |
| 560 | st_name_cache_hits_total = rrdset_create_localhost( |
| 561 | "ad", |
| 562 | "name_cache_hits", |
| 563 | NULL, |
| 564 | "database", |
| 565 | "ad.name_cache_hits", |
| 566 | "Name cache hits", |
| 567 | "hits/s", |
| 568 | PLUGIN_WINDOWS_NAME, |
| 569 | "PerflibAD", |
| 570 | PRIO_AD_CACHE_HITS_TOTAL, |
| 571 | update_every, |
| 572 | RRDSET_TYPE_LINE); |
| 573 | |
| 574 | rd_name_cache_hits_total = rrddim_add(st_name_cache_hits_total, "hits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 575 | } |
| 576 | |
| 577 | rrddim_set_by_pointer( |
| 578 | st_name_cache_hits_total, rd_name_cache_hits_total, (collected_number)nameCacheHitsTotal.current.Data); |
| 579 | rrdset_done(st_name_cache_hits_total); |
| 580 | } |
| 581 | |
| 582 | static void netdata_ad_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 583 | { |
| 584 | static COUNTER_DATA ldapSearchesTotal = {.key = "LDAP Searches/sec"}; |
| 585 | |
| 586 | static RRDSET *st_ldap_searches_total = NULL; |
| 587 | static RRDDIM *rd_ldap_searches_total = NULL; |
| 588 | |
| 589 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapSearchesTotal)) { |
| 590 | return; |
| 591 | } |
| 592 | |
| 593 | if (unlikely(!st_ldap_searches_total)) { |
| 594 | st_ldap_searches_total = rrdset_create_localhost( |
| 595 | "ad", |
| 596 | "ldap_searches", |
| 597 | NULL, |
| 598 | "ldap", |
| 599 | "ad.ldap_searches", |
| 600 | "LDAP client search operations", |
| 601 | "searches/s", |
| 602 | PLUGIN_WINDOWS_NAME, |
| 603 | "PerflibAD", |
| 604 | PRIO_AD_LDAP_SEARCHES_TOTAL, |
| 605 | update_every, |
| 606 | RRDSET_TYPE_LINE); |
| 607 | |
| 608 | rd_ldap_searches_total = rrddim_add(st_ldap_searches_total, "searches", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 609 | } |
| 610 | |
| 611 | rrddim_set_by_pointer( |
| 612 | st_ldap_searches_total, rd_ldap_searches_total, (collected_number)ldapSearchesTotal.current.Data); |
| 613 | rrdset_done(st_ldap_searches_total); |
| 614 | } |
| 615 | |
| 616 | static void netdata_ad_properties(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 617 | { |
| 618 | static COUNTER_DATA replicationInboundPropertiesUpdatedTotal = {.key = "DRA Inbound Properties Applied/sec"}; |
| 619 | static COUNTER_DATA replicationInboundPropertiesFilteredTotal = {.key = "DRA Inbound Properties Filtered/sec"}; |
| 620 | |
| 621 | static RRDSET *st_dra_replication_properties_updated = NULL; |
| 622 | static RRDDIM *rd_dra_replication_properties_updated = NULL; |
| 623 | static RRDSET *st_dra_replication_properties_filtered = NULL; |
| 624 | static RRDDIM *rd_dra_replication_properties_filtered = NULL; |
| 625 | |
| 626 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundPropertiesUpdatedTotal)) { |
| 627 | goto totalPropertyChart; |
| 628 | } |
| 629 | |
| 630 | if (unlikely(!st_dra_replication_properties_updated)) { |
| 631 | st_dra_replication_properties_updated = rrdset_create_localhost( |
| 632 | "ad", |
| 633 | "dra_replication_properties_updated", |
| 634 | NULL, |
| 635 | "replication", |
| 636 | "ad.dra_replication_properties_updated", |
| 637 | "DRA replication properties updated", |
| 638 | "properties/s", |
| 639 | PLUGIN_WINDOWS_NAME, |
| 640 | "PerflibAD", |
| 641 | PRIO_AD_REPLICATION_PROPERTY_UPDATED, |
| 642 | update_every, |
| 643 | RRDSET_TYPE_LINE); |
| 644 | |
| 645 | rd_dra_replication_properties_updated = |
| 646 | rrddim_add(st_dra_replication_properties_updated, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 647 | } |
| 648 | |
| 649 | rrddim_set_by_pointer( |
| 650 | st_dra_replication_properties_updated, |
| 651 | rd_dra_replication_properties_updated, |
| 652 | (collected_number)replicationInboundPropertiesUpdatedTotal.current.Data); |
| 653 | rrdset_done(st_dra_replication_properties_updated); |
| 654 | |
| 655 | totalPropertyChart: |
| 656 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundPropertiesFilteredTotal)) { |
| 657 | return; |
| 658 | } |
| 659 | |
| 660 | if (unlikely(!st_dra_replication_properties_filtered)) { |
| 661 | st_dra_replication_properties_filtered = rrdset_create_localhost( |
| 662 | "ad", |
| 663 | "dra_replication_properties_filtered", |
| 664 | NULL, |
| 665 | "replication", |
| 666 | "ad.dra_replication_properties_filtered", |
| 667 | "DRA replication properties filtered", |
| 668 | "properties/s", |
| 669 | PLUGIN_WINDOWS_NAME, |
| 670 | "PerflibAD", |
| 671 | PRIO_AD_REPLICATION_PROPERTY_FILTERED, |
| 672 | update_every, |
| 673 | RRDSET_TYPE_LINE); |
| 674 | |
| 675 | rd_dra_replication_properties_filtered = |
| 676 | rrddim_add(st_dra_replication_properties_filtered, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 677 | } |
| 678 | |
| 679 | rrddim_set_by_pointer( |
| 680 | st_dra_replication_properties_filtered, |
| 681 | rd_dra_replication_properties_filtered, |
| 682 | (collected_number)replicationInboundPropertiesFilteredTotal.current.Data); |
| 683 | rrdset_done(st_dra_replication_properties_filtered); |
| 684 | } |
| 685 | |
| 686 | static void netdata_ad_compressed_traffic(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 687 | { |
| 688 | static COUNTER_DATA replicationInboundDataInterSiteBytesTotal = { |
| 689 | .key = "DRA Inbound Bytes Compressed (Between Sites, After Compression)/sec"}; |
| 690 | static COUNTER_DATA replicationOutboundDataInterSiteBytesTotal = { |
| 691 | .key = "DRA Outbound Bytes Compressed (Between Sites, After Compression)/sec"}; |
| 692 | |
| 693 | static COUNTER_DATA replicationDataInboundIntraSiteBytesTotal = { |
| 694 | .key = "DRA Inbound Bytes Not Compressed (Within Site)/sec"}; |
| 695 | static COUNTER_DATA replicationDataOutboundIntraSiteBytesTotal = { |
| 696 | .key = "DRA Outbound Bytes Not Compressed (Within Site)/sec"}; |
| 697 | |
| 698 | static RRDSET *st_dra_replication_intersite_compressed_traffic = NULL; |
| 699 | static RRDDIM *rd_replication_data_intersite_bytes_total_inbound = NULL; |
| 700 | static RRDDIM *rd_replication_data_intersite_bytes_total_outbound = NULL; |
| 701 | |
| 702 | static RRDSET *st_dra_replication_intrasite_uncompressed_traffic = NULL; |
| 703 | static RRDDIM *rd_replication_data_intrasite_bytes_total_inbound = NULL; |
| 704 | static RRDDIM *rd_replication_data_intrasite_bytes_total_outbound = NULL; |
| 705 | |
| 706 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundDataInterSiteBytesTotal) || |
| 707 | !perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundDataInterSiteBytesTotal)) { |
| 708 | goto intraChart; |
| 709 | } |
| 710 | |
| 711 | if (unlikely(!st_dra_replication_intersite_compressed_traffic)) { |
| 712 | st_dra_replication_intersite_compressed_traffic = rrdset_create_localhost( |
| 713 | "ad", |
| 714 | "dra_replication_intersite_compressed_traffic", |
| 715 | NULL, |
| 716 | "replication", |
| 717 | "ad.dra_replication_intersite_compressed_traffic", |
| 718 | "DRA replication compressed traffic between sites", |
| 719 | "bytes/s", |
| 720 | PLUGIN_WINDOWS_NAME, |
| 721 | "PerflibAD", |
| 722 | PRIO_AD_REPLICATION_INTERSITE_COMPRESSED, |
| 723 | update_every, |
| 724 | RRDSET_TYPE_AREA); |
| 725 | |
| 726 | rd_replication_data_intersite_bytes_total_inbound = rrddim_add( |
| 727 | st_dra_replication_intersite_compressed_traffic, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 728 | |
| 729 | rd_replication_data_intersite_bytes_total_outbound = rrddim_add( |
| 730 | st_dra_replication_intersite_compressed_traffic, "outbound", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 731 | } |
| 732 | |
| 733 | rrddim_set_by_pointer( |
| 734 | st_dra_replication_intersite_compressed_traffic, |
| 735 | rd_replication_data_intersite_bytes_total_inbound, |
| 736 | (collected_number)replicationInboundDataInterSiteBytesTotal.current.Data); |
| 737 | rrddim_set_by_pointer( |
| 738 | st_dra_replication_intersite_compressed_traffic, |
| 739 | rd_replication_data_intersite_bytes_total_outbound, |
| 740 | (collected_number)replicationOutboundDataInterSiteBytesTotal.current.Data); |
| 741 | rrdset_done(st_dra_replication_intersite_compressed_traffic); |
| 742 | |
| 743 | intraChart: |
| 744 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationDataInboundIntraSiteBytesTotal) || |
| 745 | !perflibGetObjectCounter(pDataBlock, pObjectType, &replicationDataOutboundIntraSiteBytesTotal)) { |
| 746 | return; |
| 747 | } |
| 748 | |
| 749 | if (unlikely(!st_dra_replication_intrasite_uncompressed_traffic)) { |
| 750 | st_dra_replication_intrasite_uncompressed_traffic = rrdset_create_localhost( |
| 751 | "ad", |
| 752 | "dra_replication_intrasite_uncompressed_traffic", |
| 753 | NULL, |
| 754 | "replication", |
| 755 | "ad.dra_replication_intrasite_uncompressed_traffic", |
| 756 | "DRA replication uncompressed traffic within site", |
| 757 | "bytes/s", |
| 758 | PLUGIN_WINDOWS_NAME, |
| 759 | "PerflibAD", |
| 760 | PRIO_AD_REPLICATION_INTRASITE_UNCOMPRESSED, |
| 761 | update_every, |
| 762 | RRDSET_TYPE_AREA); |
| 763 | |
| 764 | rd_replication_data_intrasite_bytes_total_inbound = rrddim_add( |
| 765 | st_dra_replication_intrasite_uncompressed_traffic, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 766 | |
| 767 | rd_replication_data_intrasite_bytes_total_outbound = rrddim_add( |
| 768 | st_dra_replication_intrasite_uncompressed_traffic, "outbound", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 769 | } |
| 770 | |
| 771 | rrddim_set_by_pointer( |
| 772 | st_dra_replication_intrasite_uncompressed_traffic, |
| 773 | rd_replication_data_intrasite_bytes_total_inbound, |
| 774 | (collected_number)replicationDataInboundIntraSiteBytesTotal.current.Data); |
| 775 | rrddim_set_by_pointer( |
| 776 | st_dra_replication_intrasite_uncompressed_traffic, |
| 777 | rd_replication_data_intrasite_bytes_total_outbound, |
| 778 | (collected_number)replicationDataOutboundIntraSiteBytesTotal.current.Data); |
| 779 | rrdset_done(st_dra_replication_intrasite_uncompressed_traffic); |
| 780 | } |
| 781 | |
| 782 | static void netdata_ad_replication_highest_usn_committed( |
| 783 | PERF_DATA_BLOCK *pDataBlock, |
| 784 | PERF_OBJECT_TYPE *pObjectType, |
| 785 | int update_every) |
| 786 | { |
| 787 | static COUNTER_DATA replicationHighestUSNCommittedHighPart = {.key = "DRA Highest USN Committed (High part)"}; |
| 788 | static COUNTER_DATA replicationHighestUSNCommittedLowPart = {.key = "DRA Highest USN Committed (Low part)"}; |
| 789 | static RRDSET *st_replication_highest_usn_committed = NULL; |
| 790 | static RRDDIM *rd_replication_highest_usn_committed = NULL; |
| 791 | |
| 792 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationHighestUSNCommittedHighPart) || |
| 793 | !perflibGetObjectCounter(pDataBlock, pObjectType, &replicationHighestUSNCommittedLowPart)) |
| 794 | return; |
| 795 | |
| 796 | if (unlikely(!st_replication_highest_usn_committed)) { |
| 797 | st_replication_highest_usn_committed = rrdset_create_localhost( |
| 798 | "ad", |
| 799 | "replication_highest_usn_committed", |
| 800 | NULL, |
| 801 | "replication", |
| 802 | "ad.replication_highest_usn_committed", |
| 803 | "Highest replication committed update sequence number", |
| 804 | "usn/s", |
| 805 | PLUGIN_WINDOWS_NAME, |
| 806 | "PerflibAD", |
| 807 | PRIO_AD_REPLICATION_HIGHEST_USN_COMMITTED, |
| 808 | update_every, |
| 809 | RRDSET_TYPE_LINE); |
| 810 | |
| 811 | rd_replication_highest_usn_committed = |
| 812 | rrddim_add(st_replication_highest_usn_committed, "committed", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 813 | } |
| 814 | |
| 815 | // Windows exposes the 64-bit USN as separate high/low perf counters. |
| 816 | uint64_t committed = ((uint64_t)replicationHighestUSNCommittedHighPart.current.Data << 32) | |
| 817 | (uint64_t)replicationHighestUSNCommittedLowPart.current.Data; |
| 818 | |
| 819 | rrddim_set_by_pointer( |
| 820 | st_replication_highest_usn_committed, rd_replication_highest_usn_committed, (collected_number)committed); |
| 821 | rrdset_done(st_replication_highest_usn_committed); |
| 822 | } |
| 823 | |
| 824 | static void |
| 825 | netdata_ad_replication_highest_usn_issued(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 826 | { |
| 827 | static COUNTER_DATA replicationHighestUSNIssuedHighPart = {.key = "DRA Highest USN Issued (High part)"}; |
| 828 | static COUNTER_DATA replicationHighestUSNIssuedLowPart = {.key = "DRA Highest USN Issued (Low part)"}; |
| 829 | static RRDSET *st_replication_highest_usn_issued = NULL; |
| 830 | static RRDDIM *rd_replication_highest_usn_issued = NULL; |
| 831 | |
| 832 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationHighestUSNIssuedHighPart) || |
| 833 | !perflibGetObjectCounter(pDataBlock, pObjectType, &replicationHighestUSNIssuedLowPart)) |
| 834 | return; |
| 835 | |
| 836 | if (unlikely(!st_replication_highest_usn_issued)) { |
| 837 | st_replication_highest_usn_issued = rrdset_create_localhost( |
| 838 | "ad", |
| 839 | "replication_highest_usn_issued", |
| 840 | NULL, |
| 841 | "replication", |
| 842 | "ad.replication_highest_usn_issued", |
| 843 | "Highest replication issued update sequence number", |
| 844 | "usn/s", |
| 845 | PLUGIN_WINDOWS_NAME, |
| 846 | "PerflibAD", |
| 847 | PRIO_AD_REPLICATION_HIGHEST_USN_ISSUED, |
| 848 | update_every, |
| 849 | RRDSET_TYPE_LINE); |
| 850 | |
| 851 | rd_replication_highest_usn_issued = |
| 852 | rrddim_add(st_replication_highest_usn_issued, "issued", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 853 | } |
| 854 | |
| 855 | // Windows exposes the 64-bit USN as separate high/low perf counters. |
| 856 | uint64_t issued = ((uint64_t)replicationHighestUSNIssuedHighPart.current.Data << 32) | |
| 857 | (uint64_t)replicationHighestUSNIssuedLowPart.current.Data; |
| 858 | |
| 859 | rrddim_set_by_pointer( |
| 860 | st_replication_highest_usn_issued, rd_replication_highest_usn_issued, (collected_number)issued); |
| 861 | rrdset_done(st_replication_highest_usn_issued); |
| 862 | } |
| 863 | |
| 864 | static void |
| 865 | netdata_ad_replication_highest_usn(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 866 | { |
| 867 | netdata_ad_replication_highest_usn_committed(pDataBlock, pObjectType, update_every); |
| 868 | netdata_ad_replication_highest_usn_issued(pDataBlock, pObjectType, update_every); |
| 869 | } |
| 870 | |
| 871 | static void netdata_ad_replication_inbound_sync_objects_remaining( |
| 872 | PERF_DATA_BLOCK *pDataBlock, |
| 873 | PERF_OBJECT_TYPE *pObjectType, |
| 874 | int update_every) |
| 875 | { |
| 876 | static COUNTER_DATA replicationInboundSyncObjectsRemaining = {.key = "DRA Inbound Full Sync Objects Remaining"}; |
| 877 | static RRDSET *st_replication_inbound_sync_objects_remaining = NULL; |
| 878 | static RRDDIM *rd_replication_inbound_sync_objects_remaining = NULL; |
| 879 | |
| 880 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundSyncObjectsRemaining)) |
| 881 | return; |
| 882 | |
| 883 | if (unlikely(!st_replication_inbound_sync_objects_remaining)) { |
| 884 | st_replication_inbound_sync_objects_remaining = rrdset_create_localhost( |
| 885 | "ad", |
| 886 | "replication_inbound_sync_objects_remaining", |
| 887 | NULL, |
| 888 | "replication", |
| 889 | "ad.replication_inbound_sync_objects_remaining", |
| 890 | "Replication inbound sync objects remaining", |
| 891 | "objects", |
| 892 | PLUGIN_WINDOWS_NAME, |
| 893 | "PerflibAD", |
| 894 | PRIO_AD_REPLICATION_INBOUND_SYNC_OBJECTS_REMAINING, |
| 895 | update_every, |
| 896 | RRDSET_TYPE_LINE); |
| 897 | |
| 898 | rd_replication_inbound_sync_objects_remaining = |
| 899 | rrddim_add(st_replication_inbound_sync_objects_remaining, "remaining", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 900 | } |
| 901 | |
| 902 | rrddim_set_by_pointer( |
| 903 | st_replication_inbound_sync_objects_remaining, |
| 904 | rd_replication_inbound_sync_objects_remaining, |
| 905 | (collected_number)replicationInboundSyncObjectsRemaining.current.Data); |
| 906 | rrdset_done(st_replication_inbound_sync_objects_remaining); |
| 907 | } |
| 908 | |
| 909 | static void netdata_ad_replication_inbound_link_value_updates_remaining( |
| 910 | PERF_DATA_BLOCK *pDataBlock, |
| 911 | PERF_OBJECT_TYPE *pObjectType, |
| 912 | int update_every) |
| 913 | { |
| 914 | static COUNTER_DATA replicationInboundLinkValueUpdatesRemaining = { |
| 915 | .key = "DRA Inbound Link Value Updates Remaining in Packet"}; |
| 916 | static RRDSET *st_replication_inbound_link_value_updates_remaining = NULL; |
| 917 | static RRDDIM *rd_replication_inbound_link_value_updates_remaining = NULL; |
| 918 | |
| 919 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundLinkValueUpdatesRemaining)) |
| 920 | return; |
| 921 | |
| 922 | if (unlikely(!st_replication_inbound_link_value_updates_remaining)) { |
| 923 | st_replication_inbound_link_value_updates_remaining = rrdset_create_localhost( |
| 924 | "ad", |
| 925 | "replication_inbound_link_value_updates_remaining", |
| 926 | NULL, |
| 927 | "replication", |
| 928 | "ad.replication_inbound_link_value_updates_remaining", |
| 929 | "Replication inbound link value updates remaining", |
| 930 | "updates", |
| 931 | PLUGIN_WINDOWS_NAME, |
| 932 | "PerflibAD", |
| 933 | PRIO_AD_REPLICATION_INBOUND_LINK_VALUE_UPDATES_REMAINING, |
| 934 | update_every, |
| 935 | RRDSET_TYPE_LINE); |
| 936 | |
| 937 | rd_replication_inbound_link_value_updates_remaining = rrddim_add( |
| 938 | st_replication_inbound_link_value_updates_remaining, "remaining", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 939 | } |
| 940 | |
| 941 | rrddim_set_by_pointer( |
| 942 | st_replication_inbound_link_value_updates_remaining, |
| 943 | rd_replication_inbound_link_value_updates_remaining, |
| 944 | (collected_number)replicationInboundLinkValueUpdatesRemaining.current.Data); |
| 945 | rrdset_done(st_replication_inbound_link_value_updates_remaining); |
| 946 | } |
| 947 | |
| 948 | static void netdata_ad_replication_inbound_objects_updated( |
| 949 | PERF_DATA_BLOCK *pDataBlock, |
| 950 | PERF_OBJECT_TYPE *pObjectType, |
| 951 | int update_every) |
| 952 | { |
| 953 | static COUNTER_DATA replicationInboundObjectsUpdatedTotal = {.key = "DRA Inbound Objects Applied/sec"}; |
| 954 | static RRDSET *st_replication_inbound_objects_updated = NULL; |
| 955 | static RRDDIM *rd_replication_inbound_objects_updated = NULL; |
| 956 | |
| 957 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundObjectsUpdatedTotal)) |
| 958 | return; |
| 959 | |
| 960 | if (unlikely(!st_replication_inbound_objects_updated)) { |
| 961 | st_replication_inbound_objects_updated = rrdset_create_localhost( |
| 962 | "ad", |
| 963 | "replication_inbound_objects_updated", |
| 964 | NULL, |
| 965 | "replication", |
| 966 | "ad.replication_inbound_objects_updated", |
| 967 | "Replication inbound objects updated", |
| 968 | "objects/s", |
| 969 | PLUGIN_WINDOWS_NAME, |
| 970 | "PerflibAD", |
| 971 | PRIO_AD_REPLICATION_INBOUND_OBJECTS_UPDATED, |
| 972 | update_every, |
| 973 | RRDSET_TYPE_LINE); |
| 974 | |
| 975 | rd_replication_inbound_objects_updated = |
| 976 | rrddim_add(st_replication_inbound_objects_updated, "updated", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 977 | } |
| 978 | |
| 979 | rrddim_set_by_pointer( |
| 980 | st_replication_inbound_objects_updated, |
| 981 | rd_replication_inbound_objects_updated, |
| 982 | (collected_number)replicationInboundObjectsUpdatedTotal.current.Data); |
| 983 | rrdset_done(st_replication_inbound_objects_updated); |
| 984 | } |
| 985 | |
| 986 | static void netdata_ad_replication_inbound_objects_filtered( |
| 987 | PERF_DATA_BLOCK *pDataBlock, |
| 988 | PERF_OBJECT_TYPE *pObjectType, |
| 989 | int update_every) |
| 990 | { |
| 991 | static COUNTER_DATA replicationInboundObjectsFilteredTotal = {.key = "DRA Inbound Objects Filtered/sec"}; |
| 992 | static RRDSET *st_replication_inbound_objects_filtered = NULL; |
| 993 | static RRDDIM *rd_replication_inbound_objects_filtered = NULL; |
| 994 | |
| 995 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundObjectsFilteredTotal)) |
| 996 | return; |
| 997 | |
| 998 | if (unlikely(!st_replication_inbound_objects_filtered)) { |
| 999 | st_replication_inbound_objects_filtered = rrdset_create_localhost( |
| 1000 | "ad", |
| 1001 | "replication_inbound_objects_filtered", |
| 1002 | NULL, |
| 1003 | "replication", |
| 1004 | "ad.replication_inbound_objects_filtered", |
| 1005 | "Replication inbound objects filtered", |
| 1006 | "objects/s", |
| 1007 | PLUGIN_WINDOWS_NAME, |
| 1008 | "PerflibAD", |
| 1009 | PRIO_AD_REPLICATION_INBOUND_OBJECTS_FILTERED, |
| 1010 | update_every, |
| 1011 | RRDSET_TYPE_LINE); |
| 1012 | |
| 1013 | rd_replication_inbound_objects_filtered = |
| 1014 | rrddim_add(st_replication_inbound_objects_filtered, "filtered", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1015 | } |
| 1016 | |
| 1017 | rrddim_set_by_pointer( |
| 1018 | st_replication_inbound_objects_filtered, |
| 1019 | rd_replication_inbound_objects_filtered, |
| 1020 | (collected_number)replicationInboundObjectsFilteredTotal.current.Data); |
| 1021 | rrdset_done(st_replication_inbound_objects_filtered); |
| 1022 | } |
| 1023 | |
| 1024 | static void netdata_ad_replication_inbound(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1025 | { |
| 1026 | netdata_ad_replication_inbound_sync_objects_remaining(pDataBlock, pObjectType, update_every); |
| 1027 | netdata_ad_replication_inbound_link_value_updates_remaining(pDataBlock, pObjectType, update_every); |
| 1028 | netdata_ad_replication_inbound_objects_updated(pDataBlock, pObjectType, update_every); |
| 1029 | netdata_ad_replication_inbound_objects_filtered(pDataBlock, pObjectType, update_every); |
| 1030 | } |
| 1031 | |
| 1032 | static void netdata_ad_sync(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1033 | { |
| 1034 | static COUNTER_DATA replicationSyncPending = {.key = "DRA Pending Replication Synchronizations"}; |
| 1035 | static COUNTER_DATA replicationSyncRequestsTotal = {.key = "DRA Sync Requests Made"}; |
| 1036 | |
| 1037 | static RRDSET *st_dra_replication_pending_syncs = NULL; |
| 1038 | static RRDDIM *rd_dra_replication_pending_syncs = NULL; |
| 1039 | static RRDSET *st_dra_replication_sync_requests = NULL; |
| 1040 | static RRDDIM *rd_dra_replication_sync_requests = NULL; |
| 1041 | |
| 1042 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationSyncPending)) { |
| 1043 | goto totalSyncChart; |
| 1044 | } |
| 1045 | |
| 1046 | if (unlikely(!st_dra_replication_pending_syncs)) { |
| 1047 | st_dra_replication_pending_syncs = rrdset_create_localhost( |
| 1048 | "ad", |
| 1049 | "dra_replication_pending_syncs", |
| 1050 | NULL, |
| 1051 | "replication", |
| 1052 | "ad.dra_replication_pending_syncs", |
| 1053 | "DRA replication pending syncs", |
| 1054 | "syncs", |
| 1055 | PLUGIN_WINDOWS_NAME, |
| 1056 | "PerflibAD", |
| 1057 | PRIO_AD_SYNC_PENDING, |
| 1058 | update_every, |
| 1059 | RRDSET_TYPE_LINE); |
| 1060 | |
| 1061 | rd_dra_replication_pending_syncs = |
| 1062 | rrddim_add(st_dra_replication_pending_syncs, "pending", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1063 | } |
| 1064 | |
| 1065 | rrddim_set_by_pointer( |
| 1066 | st_dra_replication_pending_syncs, |
| 1067 | rd_dra_replication_pending_syncs, |
| 1068 | (collected_number)replicationSyncPending.current.Data); |
| 1069 | rrdset_done(st_dra_replication_pending_syncs); |
| 1070 | |
| 1071 | totalSyncChart: |
| 1072 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationSyncRequestsTotal)) { |
| 1073 | return; |
| 1074 | } |
| 1075 | |
| 1076 | if (unlikely(!st_dra_replication_sync_requests)) { |
| 1077 | st_dra_replication_sync_requests = rrdset_create_localhost( |
| 1078 | "ad", |
| 1079 | "dra_replication_sync_requests", |
| 1080 | NULL, |
| 1081 | "replication", |
| 1082 | "ad.dra_replication_sync_requests", |
| 1083 | "DRA replication sync requests", |
| 1084 | "requests/s", |
| 1085 | PLUGIN_WINDOWS_NAME, |
| 1086 | "PerflibAD", |
| 1087 | PRIO_AD_SYNC_TOTAL, |
| 1088 | update_every, |
| 1089 | RRDSET_TYPE_LINE); |
| 1090 | |
| 1091 | rd_dra_replication_sync_requests = |
| 1092 | rrddim_add(st_dra_replication_sync_requests, "request", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1093 | } |
| 1094 | |
| 1095 | rrddim_set_by_pointer( |
| 1096 | st_dra_replication_sync_requests, |
| 1097 | rd_dra_replication_sync_requests, |
| 1098 | (collected_number)replicationSyncRequestsTotal.current.Data); |
| 1099 | rrdset_done(st_dra_replication_sync_requests); |
| 1100 | } |
| 1101 | |
| 1102 | static void |
| 1103 | netdata_ad_replication_pending_operations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1104 | { |
| 1105 | static COUNTER_DATA replicationPendingOperations = {.key = "DRA Pending Replication Operations"}; |
| 1106 | |
| 1107 | static RRDSET *st_replication_pending_operations = NULL; |
| 1108 | static RRDDIM *rd_replication_pending_operations = NULL; |
| 1109 | |
| 1110 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationPendingOperations)) |
| 1111 | return; |
| 1112 | |
| 1113 | if (unlikely(!st_replication_pending_operations)) { |
| 1114 | st_replication_pending_operations = rrdset_create_localhost( |
| 1115 | "ad", |
| 1116 | "replication_pending_operations", |
| 1117 | NULL, |
| 1118 | "replication", |
| 1119 | "ad.replication_pending_operations", |
| 1120 | "Replication pending operations", |
| 1121 | "operations", |
| 1122 | PLUGIN_WINDOWS_NAME, |
| 1123 | "PerflibAD", |
| 1124 | PRIO_AD_REPLICATION_PENDING_OPERATIONS, |
| 1125 | update_every, |
| 1126 | RRDSET_TYPE_LINE); |
| 1127 | |
| 1128 | rd_replication_pending_operations = |
| 1129 | rrddim_add(st_replication_pending_operations, "pending", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1130 | } |
| 1131 | |
| 1132 | rrddim_set_by_pointer( |
| 1133 | st_replication_pending_operations, |
| 1134 | rd_replication_pending_operations, |
| 1135 | (collected_number)replicationPendingOperations.current.Data); |
| 1136 | rrdset_done(st_replication_pending_operations); |
| 1137 | } |
| 1138 | |
| 1139 | static void netdata_ad_sync_result_success(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1140 | { |
| 1141 | static COUNTER_DATA replicationSyncRequestsSuccessTotal = {.key = "DRA Sync Requests Successful"}; |
| 1142 | static RRDSET *st_replication_sync_requests_success = NULL; |
| 1143 | static RRDDIM *rd_replication_sync_requests_success = NULL; |
| 1144 | |
| 1145 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationSyncRequestsSuccessTotal)) |
| 1146 | return; |
| 1147 | |
| 1148 | if (unlikely(!st_replication_sync_requests_success)) { |
| 1149 | st_replication_sync_requests_success = rrdset_create_localhost( |
| 1150 | "ad", |
| 1151 | "replication_sync_requests_success", |
| 1152 | NULL, |
| 1153 | "replication", |
| 1154 | "ad.replication_sync_requests_success", |
| 1155 | "Replication sync requests successful", |
| 1156 | "requests/s", |
| 1157 | PLUGIN_WINDOWS_NAME, |
| 1158 | "PerflibAD", |
| 1159 | PRIO_AD_SYNC_SUCCESS_TOTAL, |
| 1160 | update_every, |
| 1161 | RRDSET_TYPE_LINE); |
| 1162 | |
| 1163 | rd_replication_sync_requests_success = |
| 1164 | rrddim_add(st_replication_sync_requests_success, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1165 | } |
| 1166 | |
| 1167 | rrddim_set_by_pointer( |
| 1168 | st_replication_sync_requests_success, |
| 1169 | rd_replication_sync_requests_success, |
| 1170 | (collected_number)replicationSyncRequestsSuccessTotal.current.Data); |
| 1171 | rrdset_done(st_replication_sync_requests_success); |
| 1172 | } |
| 1173 | |
| 1174 | static void netdata_ad_sync_result_schema_mismatch_failure( |
| 1175 | PERF_DATA_BLOCK *pDataBlock, |
| 1176 | PERF_OBJECT_TYPE *pObjectType, |
| 1177 | int update_every) |
| 1178 | { |
| 1179 | static COUNTER_DATA replicationSyncRequestsSchemaMismatchFailureTotal = { |
| 1180 | .key = "DRA Sync Failures on Schema Mismatch"}; |
| 1181 | static RRDSET *st_replication_sync_requests_schema_mismatch_failure = NULL; |
| 1182 | static RRDDIM *rd_replication_sync_requests_schema_mismatch_failure = NULL; |
| 1183 | |
| 1184 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationSyncRequestsSchemaMismatchFailureTotal)) |
| 1185 | return; |
| 1186 | |
| 1187 | if (unlikely(!st_replication_sync_requests_schema_mismatch_failure)) { |
| 1188 | st_replication_sync_requests_schema_mismatch_failure = rrdset_create_localhost( |
| 1189 | "ad", |
| 1190 | "replication_sync_requests_schema_mismatch_failure", |
| 1191 | NULL, |
| 1192 | "replication", |
| 1193 | "ad.replication_sync_requests_schema_mismatch_failure", |
| 1194 | "Replication sync requests failed due to schema mismatch", |
| 1195 | "requests/s", |
| 1196 | PLUGIN_WINDOWS_NAME, |
| 1197 | "PerflibAD", |
| 1198 | PRIO_AD_SYNC_SCHEMA_MISMATCH_FAILURE_TOTAL, |
| 1199 | update_every, |
| 1200 | RRDSET_TYPE_LINE); |
| 1201 | |
| 1202 | rd_replication_sync_requests_schema_mismatch_failure = rrddim_add( |
| 1203 | st_replication_sync_requests_schema_mismatch_failure, "failure", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1204 | } |
| 1205 | |
| 1206 | rrddim_set_by_pointer( |
| 1207 | st_replication_sync_requests_schema_mismatch_failure, |
| 1208 | rd_replication_sync_requests_schema_mismatch_failure, |
| 1209 | (collected_number)replicationSyncRequestsSchemaMismatchFailureTotal.current.Data); |
| 1210 | rrdset_done(st_replication_sync_requests_schema_mismatch_failure); |
| 1211 | } |
| 1212 | |
| 1213 | static void netdata_ad_sync_result(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1214 | { |
| 1215 | netdata_ad_sync_result_success(pDataBlock, pObjectType, update_every); |
| 1216 | netdata_ad_sync_result_schema_mismatch_failure(pDataBlock, pObjectType, update_every); |
| 1217 | } |
| 1218 | |
| 1219 | static void |
| 1220 | netdata_ad_name_translations_client(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1221 | { |
| 1222 | static COUNTER_DATA clientNameTranslationsPerSec = {.key = "DS Client Name Translations/sec"}; |
| 1223 | static RRDSET *st_name_translations_client = NULL; |
| 1224 | static RRDDIM *rd_name_translations_client = NULL; |
| 1225 | |
| 1226 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &clientNameTranslationsPerSec)) |
| 1227 | return; |
| 1228 | |
| 1229 | if (unlikely(!st_name_translations_client)) { |
| 1230 | st_name_translations_client = rrdset_create_localhost( |
| 1231 | "ad", |
| 1232 | "name_translations_client", |
| 1233 | NULL, |
| 1234 | "directory", |
| 1235 | "ad.name_translations_client", |
| 1236 | "Client name translations", |
| 1237 | "translations/s", |
| 1238 | PLUGIN_WINDOWS_NAME, |
| 1239 | "PerflibAD", |
| 1240 | PRIO_AD_NAME_TRANSLATIONS_CLIENT, |
| 1241 | update_every, |
| 1242 | RRDSET_TYPE_LINE); |
| 1243 | |
| 1244 | rd_name_translations_client = |
| 1245 | rrddim_add(st_name_translations_client, "client", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1246 | } |
| 1247 | |
| 1248 | rrddim_set_by_pointer( |
| 1249 | st_name_translations_client, |
| 1250 | rd_name_translations_client, |
| 1251 | (collected_number)clientNameTranslationsPerSec.current.Data); |
| 1252 | rrdset_done(st_name_translations_client); |
| 1253 | } |
| 1254 | |
| 1255 | static void |
| 1256 | netdata_ad_name_translations_server(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1257 | { |
| 1258 | static COUNTER_DATA serverNameTranslationsPerSec = {.key = "DS Server Name Translations/sec"}; |
| 1259 | static RRDSET *st_name_translations_server = NULL; |
| 1260 | static RRDDIM *rd_name_translations_server = NULL; |
| 1261 | |
| 1262 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &serverNameTranslationsPerSec)) |
| 1263 | return; |
| 1264 | |
| 1265 | if (unlikely(!st_name_translations_server)) { |
| 1266 | st_name_translations_server = rrdset_create_localhost( |
| 1267 | "ad", |
| 1268 | "name_translations_server", |
| 1269 | NULL, |
| 1270 | "directory", |
| 1271 | "ad.name_translations_server", |
| 1272 | "Server name translations", |
| 1273 | "translations/s", |
| 1274 | PLUGIN_WINDOWS_NAME, |
| 1275 | "PerflibAD", |
| 1276 | PRIO_AD_NAME_TRANSLATIONS_SERVER, |
| 1277 | update_every, |
| 1278 | RRDSET_TYPE_LINE); |
| 1279 | |
| 1280 | rd_name_translations_server = |
| 1281 | rrddim_add(st_name_translations_server, "server", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1282 | } |
| 1283 | |
| 1284 | rrddim_set_by_pointer( |
| 1285 | st_name_translations_server, |
| 1286 | rd_name_translations_server, |
| 1287 | (collected_number)serverNameTranslationsPerSec.current.Data); |
| 1288 | rrdset_done(st_name_translations_server); |
| 1289 | } |
| 1290 | |
| 1291 | static void netdata_ad_name_translations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1292 | { |
| 1293 | netdata_ad_name_translations_client(pDataBlock, pObjectType, update_every); |
| 1294 | netdata_ad_name_translations_server(pDataBlock, pObjectType, update_every); |
| 1295 | } |
| 1296 | |
| 1297 | static void |
| 1298 | netdata_ad_change_monitors_registered(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1299 | { |
| 1300 | static COUNTER_DATA changeMonitorsRegistered = {.key = "DS Monitor List Size"}; |
| 1301 | static RRDSET *st_change_monitors_registered = NULL; |
| 1302 | static RRDDIM *rd_change_monitors_registered = NULL; |
| 1303 | |
| 1304 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &changeMonitorsRegistered)) |
| 1305 | return; |
| 1306 | |
| 1307 | if (unlikely(!st_change_monitors_registered)) { |
| 1308 | st_change_monitors_registered = rrdset_create_localhost( |
| 1309 | "ad", |
| 1310 | "change_monitors_registered", |
| 1311 | NULL, |
| 1312 | "directory", |
| 1313 | "ad.change_monitors_registered", |
| 1314 | "Registered change monitors", |
| 1315 | "monitors", |
| 1316 | PLUGIN_WINDOWS_NAME, |
| 1317 | "PerflibAD", |
| 1318 | PRIO_AD_CHANGE_MONITORS_REGISTERED, |
| 1319 | update_every, |
| 1320 | RRDSET_TYPE_LINE); |
| 1321 | |
| 1322 | rd_change_monitors_registered = |
| 1323 | rrddim_add(st_change_monitors_registered, "registered", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1324 | } |
| 1325 | |
| 1326 | rrddim_set_by_pointer( |
| 1327 | st_change_monitors_registered, |
| 1328 | rd_change_monitors_registered, |
| 1329 | (collected_number)changeMonitorsRegistered.current.Data); |
| 1330 | rrdset_done(st_change_monitors_registered); |
| 1331 | } |
| 1332 | |
| 1333 | static void |
| 1334 | netdata_ad_change_monitor_updates_pending(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1335 | { |
| 1336 | static COUNTER_DATA changeMonitorUpdatesPending = {.key = "DS Notify Queue Size"}; |
| 1337 | static RRDSET *st_change_monitor_updates_pending = NULL; |
| 1338 | static RRDDIM *rd_change_monitor_updates_pending = NULL; |
| 1339 | |
| 1340 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &changeMonitorUpdatesPending)) |
| 1341 | return; |
| 1342 | |
| 1343 | if (unlikely(!st_change_monitor_updates_pending)) { |
| 1344 | st_change_monitor_updates_pending = rrdset_create_localhost( |
| 1345 | "ad", |
| 1346 | "change_monitor_updates_pending", |
| 1347 | NULL, |
| 1348 | "directory", |
| 1349 | "ad.change_monitor_updates_pending", |
| 1350 | "Pending change monitor updates", |
| 1351 | "updates", |
| 1352 | PLUGIN_WINDOWS_NAME, |
| 1353 | "PerflibAD", |
| 1354 | PRIO_AD_CHANGE_MONITOR_UPDATES_PENDING, |
| 1355 | update_every, |
| 1356 | RRDSET_TYPE_LINE); |
| 1357 | |
| 1358 | rd_change_monitor_updates_pending = |
| 1359 | rrddim_add(st_change_monitor_updates_pending, "pending", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1360 | } |
| 1361 | |
| 1362 | rrddim_set_by_pointer( |
| 1363 | st_change_monitor_updates_pending, |
| 1364 | rd_change_monitor_updates_pending, |
| 1365 | (collected_number)changeMonitorUpdatesPending.current.Data); |
| 1366 | rrdset_done(st_change_monitor_updates_pending); |
| 1367 | } |
| 1368 | |
| 1369 | static void netdata_ad_change_monitors(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1370 | { |
| 1371 | netdata_ad_change_monitors_registered(pDataBlock, pObjectType, update_every); |
| 1372 | netdata_ad_change_monitor_updates_pending(pDataBlock, pObjectType, update_every); |
| 1373 | } |
| 1374 | |
| 1375 | static void |
| 1376 | netdata_ad_directory_search_suboperations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1377 | { |
| 1378 | static COUNTER_DATA directorySearchSubOperationsPerSec = {.key = "DS Search sub-operations/sec"}; |
| 1379 | |
| 1380 | static RRDSET *st_directory_search_suboperations_total = NULL; |
| 1381 | static RRDDIM *rd_directory_search_suboperations_total = NULL; |
| 1382 | |
| 1383 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directorySearchSubOperationsPerSec)) |
| 1384 | return; |
| 1385 | |
| 1386 | if (unlikely(!st_directory_search_suboperations_total)) { |
| 1387 | st_directory_search_suboperations_total = rrdset_create_localhost( |
| 1388 | "ad", |
| 1389 | "directory_search_suboperations", |
| 1390 | NULL, |
| 1391 | "search", |
| 1392 | "ad.directory_search_suboperations", |
| 1393 | "Directory search suboperations", |
| 1394 | "operations/s", |
| 1395 | PLUGIN_WINDOWS_NAME, |
| 1396 | "PerflibAD", |
| 1397 | PRIO_AD_DIRECTORY_SEARCH_SUBOPERATIONS_TOTAL, |
| 1398 | update_every, |
| 1399 | RRDSET_TYPE_LINE); |
| 1400 | |
| 1401 | rd_directory_search_suboperations_total = |
| 1402 | rrddim_add(st_directory_search_suboperations_total, "suboperations", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1403 | } |
| 1404 | |
| 1405 | rrddim_set_by_pointer( |
| 1406 | st_directory_search_suboperations_total, |
| 1407 | rd_directory_search_suboperations_total, |
| 1408 | (collected_number)directorySearchSubOperationsPerSec.current.Data); |
| 1409 | rrdset_done(st_directory_search_suboperations_total); |
| 1410 | } |
| 1411 | |
| 1412 | static void netdata_ad_security_descriptor_propagation_events( |
| 1413 | PERF_DATA_BLOCK *pDataBlock, |
| 1414 | PERF_OBJECT_TYPE *pObjectType, |
| 1415 | int update_every) |
| 1416 | { |
| 1417 | static COUNTER_DATA securityDescriptorSubOperationsPerSec = {.key = "DS Security Descriptor sub-operations/sec"}; |
| 1418 | static RRDSET *st_security_descriptor_propagation_events = NULL; |
| 1419 | static RRDDIM *rd_security_descriptor_propagation_events = NULL; |
| 1420 | |
| 1421 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &securityDescriptorSubOperationsPerSec)) |
| 1422 | return; |
| 1423 | |
| 1424 | if (unlikely(!st_security_descriptor_propagation_events)) { |
| 1425 | st_security_descriptor_propagation_events = rrdset_create_localhost( |
| 1426 | "ad", |
| 1427 | "security_descriptor_propagation_events", |
| 1428 | NULL, |
| 1429 | "directory", |
| 1430 | "ad.security_descriptor_propagation_events", |
| 1431 | "Security descriptor propagation events", |
| 1432 | "events/s", |
| 1433 | PLUGIN_WINDOWS_NAME, |
| 1434 | "PerflibAD", |
| 1435 | PRIO_AD_SECURITY_DESCRIPTOR_PROPAGATION_EVENTS_TOTAL, |
| 1436 | update_every, |
| 1437 | RRDSET_TYPE_LINE); |
| 1438 | |
| 1439 | rd_security_descriptor_propagation_events = |
| 1440 | rrddim_add(st_security_descriptor_propagation_events, "events", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1441 | } |
| 1442 | |
| 1443 | rrddim_set_by_pointer( |
| 1444 | st_security_descriptor_propagation_events, |
| 1445 | rd_security_descriptor_propagation_events, |
| 1446 | (collected_number)securityDescriptorSubOperationsPerSec.current.Data); |
| 1447 | rrdset_done(st_security_descriptor_propagation_events); |
| 1448 | } |
| 1449 | |
| 1450 | static void netdata_ad_security_descriptor_propagation_events_queued( |
| 1451 | PERF_DATA_BLOCK *pDataBlock, |
| 1452 | PERF_OBJECT_TYPE *pObjectType, |
| 1453 | int update_every) |
| 1454 | { |
| 1455 | static COUNTER_DATA securityDescriptorPropagationsEvents = {.key = "DS Security Descriptor Propagations Events"}; |
| 1456 | static RRDSET *st_security_descriptor_propagation_events_queued = NULL; |
| 1457 | static RRDDIM *rd_security_descriptor_propagation_events_queued = NULL; |
| 1458 | |
| 1459 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &securityDescriptorPropagationsEvents)) |
| 1460 | return; |
| 1461 | |
| 1462 | if (unlikely(!st_security_descriptor_propagation_events_queued)) { |
| 1463 | st_security_descriptor_propagation_events_queued = rrdset_create_localhost( |
| 1464 | "ad", |
| 1465 | "security_descriptor_propagation_events_queued", |
| 1466 | NULL, |
| 1467 | "directory", |
| 1468 | "ad.security_descriptor_propagation_events_queued", |
| 1469 | "Security descriptor propagation events queued", |
| 1470 | "events", |
| 1471 | PLUGIN_WINDOWS_NAME, |
| 1472 | "PerflibAD", |
| 1473 | PRIO_AD_SECURITY_DESCRIPTOR_PROPAGATION_EVENTS_QUEUED, |
| 1474 | update_every, |
| 1475 | RRDSET_TYPE_LINE); |
| 1476 | |
| 1477 | rd_security_descriptor_propagation_events_queued = |
| 1478 | rrddim_add(st_security_descriptor_propagation_events_queued, "queued", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1479 | } |
| 1480 | |
| 1481 | rrddim_set_by_pointer( |
| 1482 | st_security_descriptor_propagation_events_queued, |
| 1483 | rd_security_descriptor_propagation_events_queued, |
| 1484 | (collected_number)securityDescriptorPropagationsEvents.current.Data); |
| 1485 | rrdset_done(st_security_descriptor_propagation_events_queued); |
| 1486 | } |
| 1487 | |
| 1488 | static void netdata_ad_security_descriptor_propagation_access_wait( |
| 1489 | PERF_DATA_BLOCK *pDataBlock, |
| 1490 | PERF_OBJECT_TYPE *pObjectType, |
| 1491 | int update_every) |
| 1492 | { |
| 1493 | static COUNTER_DATA securityDescriptorPropagatorAverageExclusionTime = { |
| 1494 | .key = "DS Security Descriptor Propagator Average Exclusion Time"}; |
| 1495 | static RRDSET *st_security_descriptor_propagation_access_wait = NULL; |
| 1496 | static RRDDIM *rd_security_descriptor_propagation_access_wait = NULL; |
| 1497 | |
| 1498 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &securityDescriptorPropagatorAverageExclusionTime)) |
| 1499 | return; |
| 1500 | |
| 1501 | if (unlikely(!st_security_descriptor_propagation_access_wait)) { |
| 1502 | st_security_descriptor_propagation_access_wait = rrdset_create_localhost( |
| 1503 | "ad", |
| 1504 | "security_descriptor_propagation_access_wait", |
| 1505 | NULL, |
| 1506 | "directory", |
| 1507 | "ad.security_descriptor_propagation_access_wait", |
| 1508 | "Security descriptor propagation access wait", |
| 1509 | "seconds", |
| 1510 | PLUGIN_WINDOWS_NAME, |
| 1511 | "PerflibAD", |
| 1512 | PRIO_AD_SECURITY_DESCRIPTOR_PROPAGATION_ACCESS_WAIT_TOTAL_SECONDS, |
| 1513 | update_every, |
| 1514 | RRDSET_TYPE_LINE); |
| 1515 | |
| 1516 | rd_security_descriptor_propagation_access_wait = |
| 1517 | rrddim_add(st_security_descriptor_propagation_access_wait, "wait", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1518 | } |
| 1519 | |
| 1520 | rrddim_set_by_pointer( |
| 1521 | st_security_descriptor_propagation_access_wait, |
| 1522 | rd_security_descriptor_propagation_access_wait, |
| 1523 | (collected_number)securityDescriptorPropagatorAverageExclusionTime.current.Data); |
| 1524 | rrdset_done(st_security_descriptor_propagation_access_wait); |
| 1525 | } |
| 1526 | |
| 1527 | static void netdata_ad_security_descriptor_propagation_items_queued( |
| 1528 | PERF_DATA_BLOCK *pDataBlock, |
| 1529 | PERF_OBJECT_TYPE *pObjectType, |
| 1530 | int update_every) |
| 1531 | { |
| 1532 | static COUNTER_DATA securityDescriptorPropagatorRuntimeQueue = { |
| 1533 | .key = "DS Security Descriptor Propagator Runtime Queue"}; |
| 1534 | static RRDSET *st_security_descriptor_propagation_items_queued = NULL; |
| 1535 | static RRDDIM *rd_security_descriptor_propagation_items_queued = NULL; |
| 1536 | |
| 1537 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &securityDescriptorPropagatorRuntimeQueue)) |
| 1538 | return; |
| 1539 | |
| 1540 | if (unlikely(!st_security_descriptor_propagation_items_queued)) { |
| 1541 | st_security_descriptor_propagation_items_queued = rrdset_create_localhost( |
| 1542 | "ad", |
| 1543 | "security_descriptor_propagation_items_queued", |
| 1544 | NULL, |
| 1545 | "directory", |
| 1546 | "ad.security_descriptor_propagation_items_queued", |
| 1547 | "Security descriptor propagation items queued", |
| 1548 | "items", |
| 1549 | PLUGIN_WINDOWS_NAME, |
| 1550 | "PerflibAD", |
| 1551 | PRIO_AD_SECURITY_DESCRIPTOR_PROPAGATION_ITEMS_QUEUED_TOTAL, |
| 1552 | update_every, |
| 1553 | RRDSET_TYPE_LINE); |
| 1554 | |
| 1555 | rd_security_descriptor_propagation_items_queued = |
| 1556 | rrddim_add(st_security_descriptor_propagation_items_queued, "queued", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1557 | } |
| 1558 | |
| 1559 | rrddim_set_by_pointer( |
| 1560 | st_security_descriptor_propagation_items_queued, |
| 1561 | rd_security_descriptor_propagation_items_queued, |
| 1562 | (collected_number)securityDescriptorPropagatorRuntimeQueue.current.Data); |
| 1563 | rrdset_done(st_security_descriptor_propagation_items_queued); |
| 1564 | } |
| 1565 | |
| 1566 | static void |
| 1567 | netdata_ad_security_descriptor_propagation(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1568 | { |
| 1569 | netdata_ad_security_descriptor_propagation_events(pDataBlock, pObjectType, update_every); |
| 1570 | netdata_ad_security_descriptor_propagation_events_queued(pDataBlock, pObjectType, update_every); |
| 1571 | netdata_ad_security_descriptor_propagation_access_wait(pDataBlock, pObjectType, update_every); |
| 1572 | netdata_ad_security_descriptor_propagation_items_queued(pDataBlock, pObjectType, update_every); |
| 1573 | } |
| 1574 | |
| 1575 | static void |
| 1576 | netdata_ad_service_threads_in_use(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1577 | { |
| 1578 | static COUNTER_DATA directoryServiceThreads = {.key = "DS Threads in Use"}; |
| 1579 | |
| 1580 | static RRDSET *st_directory_services_threads = NULL; |
| 1581 | static RRDDIM *rd_directory_services_threads = NULL; |
| 1582 | |
| 1583 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directoryServiceThreads)) { |
| 1584 | return; |
| 1585 | } |
| 1586 | |
| 1587 | if (unlikely(!st_directory_services_threads)) { |
| 1588 | st_directory_services_threads = rrdset_create_localhost( |
| 1589 | "ad", |
| 1590 | "ds_threads", |
| 1591 | NULL, |
| 1592 | "threads", |
| 1593 | "ad.ds_threads", |
| 1594 | "Directory Service threads", |
| 1595 | "threads", |
| 1596 | PLUGIN_WINDOWS_NAME, |
| 1597 | "PerflibAD", |
| 1598 | PRIO_AD_THREADS_IN_USE, |
| 1599 | update_every, |
| 1600 | RRDSET_TYPE_LINE); |
| 1601 | |
| 1602 | rd_directory_services_threads = |
| 1603 | rrddim_add(st_directory_services_threads, "thread", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1604 | } |
| 1605 | |
| 1606 | rrddim_set_by_pointer( |
| 1607 | st_directory_services_threads, |
| 1608 | rd_directory_services_threads, |
| 1609 | (collected_number)directoryServiceThreads.current.Data); |
| 1610 | rrdset_done(st_directory_services_threads); |
| 1611 | } |
| 1612 | |
| 1613 | static void netdata_ad_bind_time(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1614 | { |
| 1615 | static COUNTER_DATA ldapLastBindTimeSecondsTotal = {.key = "LDAP Bind Time"}; |
| 1616 | static RRDSET *st_ldap_last_bind_time_seconds_total = NULL; |
| 1617 | static RRDDIM *rd_ldap_last_bind_time_seconds_total = NULL; |
| 1618 | |
| 1619 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapLastBindTimeSecondsTotal)) { |
| 1620 | return; |
| 1621 | } |
| 1622 | |
| 1623 | if (unlikely(!st_ldap_last_bind_time_seconds_total)) { |
| 1624 | st_ldap_last_bind_time_seconds_total = rrdset_create_localhost( |
| 1625 | "ad", |
| 1626 | "ldap_last_bind_time", |
| 1627 | NULL, |
| 1628 | "bind", |
| 1629 | "ad.ldap_last_bind_time", |
| 1630 | "LDAP last successful bind time", |
| 1631 | "seconds", |
| 1632 | PLUGIN_WINDOWS_NAME, |
| 1633 | "PerflibAD", |
| 1634 | PRIO_AD_BIND_TIME, |
| 1635 | update_every, |
| 1636 | RRDSET_TYPE_LINE); |
| 1637 | |
| 1638 | rd_ldap_last_bind_time_seconds_total = |
| 1639 | rrddim_add(st_ldap_last_bind_time_seconds_total, "last_bind", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); |
| 1640 | } |
| 1641 | |
| 1642 | rrddim_set_by_pointer( |
| 1643 | st_ldap_last_bind_time_seconds_total, |
| 1644 | rd_ldap_last_bind_time_seconds_total, |
| 1645 | (collected_number)ldapLastBindTimeSecondsTotal.current.Data); |
| 1646 | rrdset_done(st_ldap_last_bind_time_seconds_total); |
| 1647 | } |
| 1648 | |
| 1649 | static void netdata_ad_binds_digest(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1650 | { |
| 1651 | static COUNTER_DATA digestBindsPerSec = {.key = "Digest Binds/sec"}; |
| 1652 | static RRDSET *st_binds_digest = NULL; |
| 1653 | static RRDDIM *rd_binds_digest = NULL; |
| 1654 | |
| 1655 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &digestBindsPerSec)) |
| 1656 | return; |
| 1657 | |
| 1658 | if (unlikely(!st_binds_digest)) { |
| 1659 | st_binds_digest = rrdset_create_localhost( |
| 1660 | "ad", |
| 1661 | "binds_digest", |
| 1662 | NULL, |
| 1663 | "bind", |
| 1664 | "ad.binds_digest", |
| 1665 | "Digest binds", |
| 1666 | "binds/s", |
| 1667 | PLUGIN_WINDOWS_NAME, |
| 1668 | "PerflibAD", |
| 1669 | PRIO_AD_BIND_DIGEST, |
| 1670 | update_every, |
| 1671 | RRDSET_TYPE_LINE); |
| 1672 | |
| 1673 | rd_binds_digest = rrddim_add(st_binds_digest, "digest", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1674 | } |
| 1675 | |
| 1676 | rrddim_set_by_pointer(st_binds_digest, rd_binds_digest, (collected_number)digestBindsPerSec.current.Data); |
| 1677 | rrdset_done(st_binds_digest); |
| 1678 | } |
| 1679 | |
| 1680 | static void netdata_ad_binds_ds_client(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1681 | { |
| 1682 | static COUNTER_DATA dsClientBindsPerSec = {.key = "DS Client Binds/sec"}; |
| 1683 | static RRDSET *st_binds_ds_client = NULL; |
| 1684 | static RRDDIM *rd_binds_ds_client = NULL; |
| 1685 | |
| 1686 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &dsClientBindsPerSec)) |
| 1687 | return; |
| 1688 | |
| 1689 | if (unlikely(!st_binds_ds_client)) { |
| 1690 | st_binds_ds_client = rrdset_create_localhost( |
| 1691 | "ad", |
| 1692 | "binds_ds_client", |
| 1693 | NULL, |
| 1694 | "bind", |
| 1695 | "ad.binds_ds_client", |
| 1696 | "DS client binds", |
| 1697 | "binds/s", |
| 1698 | PLUGIN_WINDOWS_NAME, |
| 1699 | "PerflibAD", |
| 1700 | PRIO_AD_BIND_DS_CLIENT, |
| 1701 | update_every, |
| 1702 | RRDSET_TYPE_LINE); |
| 1703 | |
| 1704 | rd_binds_ds_client = rrddim_add(st_binds_ds_client, "ds_client", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1705 | } |
| 1706 | |
| 1707 | rrddim_set_by_pointer(st_binds_ds_client, rd_binds_ds_client, (collected_number)dsClientBindsPerSec.current.Data); |
| 1708 | rrdset_done(st_binds_ds_client); |
| 1709 | } |
| 1710 | |
| 1711 | static void netdata_ad_binds_ds_server(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1712 | { |
| 1713 | static COUNTER_DATA dsServerBindsPerSec = {.key = "DS Server Binds/sec"}; |
| 1714 | static RRDSET *st_binds_ds_server = NULL; |
| 1715 | static RRDDIM *rd_binds_ds_server = NULL; |
| 1716 | |
| 1717 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &dsServerBindsPerSec)) |
| 1718 | return; |
| 1719 | |
| 1720 | if (unlikely(!st_binds_ds_server)) { |
| 1721 | st_binds_ds_server = rrdset_create_localhost( |
| 1722 | "ad", |
| 1723 | "binds_ds_server", |
| 1724 | NULL, |
| 1725 | "bind", |
| 1726 | "ad.binds_ds_server", |
| 1727 | "DS server binds", |
| 1728 | "binds/s", |
| 1729 | PLUGIN_WINDOWS_NAME, |
| 1730 | "PerflibAD", |
| 1731 | PRIO_AD_BIND_DS_SERVER, |
| 1732 | update_every, |
| 1733 | RRDSET_TYPE_LINE); |
| 1734 | |
| 1735 | rd_binds_ds_server = rrddim_add(st_binds_ds_server, "ds_server", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1736 | } |
| 1737 | |
| 1738 | rrddim_set_by_pointer(st_binds_ds_server, rd_binds_ds_server, (collected_number)dsServerBindsPerSec.current.Data); |
| 1739 | rrdset_done(st_binds_ds_server); |
| 1740 | } |
| 1741 | |
| 1742 | static void netdata_ad_binds_external(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1743 | { |
| 1744 | static COUNTER_DATA externalBindsPerSec = {.key = "External Binds/sec"}; |
| 1745 | static RRDSET *st_binds_external = NULL; |
| 1746 | static RRDDIM *rd_binds_external = NULL; |
| 1747 | |
| 1748 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &externalBindsPerSec)) |
| 1749 | return; |
| 1750 | |
| 1751 | if (unlikely(!st_binds_external)) { |
| 1752 | st_binds_external = rrdset_create_localhost( |
| 1753 | "ad", |
| 1754 | "binds_external", |
| 1755 | NULL, |
| 1756 | "bind", |
| 1757 | "ad.binds_external", |
| 1758 | "External binds", |
| 1759 | "binds/s", |
| 1760 | PLUGIN_WINDOWS_NAME, |
| 1761 | "PerflibAD", |
| 1762 | PRIO_AD_BIND_EXTERNAL, |
| 1763 | update_every, |
| 1764 | RRDSET_TYPE_LINE); |
| 1765 | |
| 1766 | rd_binds_external = rrddim_add(st_binds_external, "external", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1767 | } |
| 1768 | |
| 1769 | rrddim_set_by_pointer(st_binds_external, rd_binds_external, (collected_number)externalBindsPerSec.current.Data); |
| 1770 | rrdset_done(st_binds_external); |
| 1771 | } |
| 1772 | |
| 1773 | static void netdata_ad_binds_fast(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1774 | { |
| 1775 | static COUNTER_DATA fastBindsPerSec = {.key = "Fast Binds/sec"}; |
| 1776 | static RRDSET *st_binds_fast = NULL; |
| 1777 | static RRDDIM *rd_binds_fast = NULL; |
| 1778 | |
| 1779 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &fastBindsPerSec)) |
| 1780 | return; |
| 1781 | |
| 1782 | if (unlikely(!st_binds_fast)) { |
| 1783 | st_binds_fast = rrdset_create_localhost( |
| 1784 | "ad", |
| 1785 | "binds_fast", |
| 1786 | NULL, |
| 1787 | "bind", |
| 1788 | "ad.binds_fast", |
| 1789 | "Fast binds", |
| 1790 | "binds/s", |
| 1791 | PLUGIN_WINDOWS_NAME, |
| 1792 | "PerflibAD", |
| 1793 | PRIO_AD_BIND_FAST, |
| 1794 | update_every, |
| 1795 | RRDSET_TYPE_LINE); |
| 1796 | |
| 1797 | rd_binds_fast = rrddim_add(st_binds_fast, "fast", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1798 | } |
| 1799 | |
| 1800 | rrddim_set_by_pointer(st_binds_fast, rd_binds_fast, (collected_number)fastBindsPerSec.current.Data); |
| 1801 | rrdset_done(st_binds_fast); |
| 1802 | } |
| 1803 | |
| 1804 | static void netdata_ad_binds_negotiate(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1805 | { |
| 1806 | static COUNTER_DATA negotiatedBindsPerSec = {.key = "Negotiated Binds/sec"}; |
| 1807 | static RRDSET *st_binds_negotiate = NULL; |
| 1808 | static RRDDIM *rd_binds_negotiate = NULL; |
| 1809 | |
| 1810 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &negotiatedBindsPerSec)) |
| 1811 | return; |
| 1812 | |
| 1813 | if (unlikely(!st_binds_negotiate)) { |
| 1814 | st_binds_negotiate = rrdset_create_localhost( |
| 1815 | "ad", |
| 1816 | "binds_negotiate", |
| 1817 | NULL, |
| 1818 | "bind", |
| 1819 | "ad.binds_negotiate", |
| 1820 | "Negotiated binds", |
| 1821 | "binds/s", |
| 1822 | PLUGIN_WINDOWS_NAME, |
| 1823 | "PerflibAD", |
| 1824 | PRIO_AD_BIND_NEGOTIATE, |
| 1825 | update_every, |
| 1826 | RRDSET_TYPE_LINE); |
| 1827 | |
| 1828 | rd_binds_negotiate = rrddim_add(st_binds_negotiate, "negotiate", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1829 | } |
| 1830 | |
| 1831 | rrddim_set_by_pointer(st_binds_negotiate, rd_binds_negotiate, (collected_number)negotiatedBindsPerSec.current.Data); |
| 1832 | rrdset_done(st_binds_negotiate); |
| 1833 | } |
| 1834 | |
| 1835 | static void netdata_ad_binds_ntlm(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1836 | { |
| 1837 | static COUNTER_DATA ntlmBindsPerSec = {.key = "NTLM Binds/sec"}; |
| 1838 | static RRDSET *st_binds_ntlm = NULL; |
| 1839 | static RRDDIM *rd_binds_ntlm = NULL; |
| 1840 | |
| 1841 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ntlmBindsPerSec)) |
| 1842 | return; |
| 1843 | |
| 1844 | if (unlikely(!st_binds_ntlm)) { |
| 1845 | st_binds_ntlm = rrdset_create_localhost( |
| 1846 | "ad", |
| 1847 | "binds_ntlm", |
| 1848 | NULL, |
| 1849 | "bind", |
| 1850 | "ad.binds_ntlm", |
| 1851 | "NTLM binds", |
| 1852 | "binds/s", |
| 1853 | PLUGIN_WINDOWS_NAME, |
| 1854 | "PerflibAD", |
| 1855 | PRIO_AD_BIND_NTLM, |
| 1856 | update_every, |
| 1857 | RRDSET_TYPE_LINE); |
| 1858 | |
| 1859 | rd_binds_ntlm = rrddim_add(st_binds_ntlm, "ntlm", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1860 | } |
| 1861 | |
| 1862 | rrddim_set_by_pointer(st_binds_ntlm, rd_binds_ntlm, (collected_number)ntlmBindsPerSec.current.Data); |
| 1863 | rrdset_done(st_binds_ntlm); |
| 1864 | } |
| 1865 | |
| 1866 | static void netdata_ad_binds_simple(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1867 | { |
| 1868 | static COUNTER_DATA simpleBindsPerSec = {.key = "Simple Binds/sec"}; |
| 1869 | static RRDSET *st_binds_simple = NULL; |
| 1870 | static RRDDIM *rd_binds_simple = NULL; |
| 1871 | |
| 1872 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &simpleBindsPerSec)) |
| 1873 | return; |
| 1874 | |
| 1875 | if (unlikely(!st_binds_simple)) { |
| 1876 | st_binds_simple = rrdset_create_localhost( |
| 1877 | "ad", |
| 1878 | "binds_simple", |
| 1879 | NULL, |
| 1880 | "bind", |
| 1881 | "ad.binds_simple", |
| 1882 | "Simple binds", |
| 1883 | "binds/s", |
| 1884 | PLUGIN_WINDOWS_NAME, |
| 1885 | "PerflibAD", |
| 1886 | PRIO_AD_BIND_SIMPLE, |
| 1887 | update_every, |
| 1888 | RRDSET_TYPE_LINE); |
| 1889 | |
| 1890 | rd_binds_simple = rrddim_add(st_binds_simple, "simple", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1891 | } |
| 1892 | |
| 1893 | rrddim_set_by_pointer(st_binds_simple, rd_binds_simple, (collected_number)simpleBindsPerSec.current.Data); |
| 1894 | rrdset_done(st_binds_simple); |
| 1895 | } |
| 1896 | |
| 1897 | static void netdata_ad_binds_ldap(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1898 | { |
| 1899 | static COUNTER_DATA ldapSuccessfulBindsPerSec = {.key = "LDAP Successful Binds/sec"}; |
| 1900 | static RRDSET *st_binds_ldap = NULL; |
| 1901 | static RRDDIM *rd_binds_ldap = NULL; |
| 1902 | |
| 1903 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapSuccessfulBindsPerSec)) |
| 1904 | return; |
| 1905 | |
| 1906 | if (unlikely(!st_binds_ldap)) { |
| 1907 | st_binds_ldap = rrdset_create_localhost( |
| 1908 | "ad", |
| 1909 | "binds_ldap", |
| 1910 | NULL, |
| 1911 | "bind", |
| 1912 | "ad.binds_ldap", |
| 1913 | "LDAP successful binds", |
| 1914 | "binds/s", |
| 1915 | PLUGIN_WINDOWS_NAME, |
| 1916 | "PerflibAD", |
| 1917 | PRIO_AD_BIND_LDAP, |
| 1918 | update_every, |
| 1919 | RRDSET_TYPE_LINE); |
| 1920 | |
| 1921 | rd_binds_ldap = rrddim_add(st_binds_ldap, "ldap", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1922 | } |
| 1923 | |
| 1924 | rrddim_set_by_pointer(st_binds_ldap, rd_binds_ldap, (collected_number)ldapSuccessfulBindsPerSec.current.Data); |
| 1925 | rrdset_done(st_binds_ldap); |
| 1926 | } |
| 1927 | |
| 1928 | static void netdata_ad_binds(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1929 | { |
| 1930 | netdata_ad_binds_digest(pDataBlock, pObjectType, update_every); |
| 1931 | netdata_ad_binds_ds_client(pDataBlock, pObjectType, update_every); |
| 1932 | netdata_ad_binds_ds_server(pDataBlock, pObjectType, update_every); |
| 1933 | netdata_ad_binds_external(pDataBlock, pObjectType, update_every); |
| 1934 | netdata_ad_binds_fast(pDataBlock, pObjectType, update_every); |
| 1935 | netdata_ad_binds_negotiate(pDataBlock, pObjectType, update_every); |
| 1936 | netdata_ad_binds_ntlm(pDataBlock, pObjectType, update_every); |
| 1937 | netdata_ad_binds_simple(pDataBlock, pObjectType, update_every); |
| 1938 | netdata_ad_binds_ldap(pDataBlock, pObjectType, update_every); |
| 1939 | } |
| 1940 | |
| 1941 | static void netdata_ad_bind(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1942 | { |
| 1943 | netdata_ad_bind_time(pDataBlock, pObjectType, update_every); |
| 1944 | netdata_ad_binds(pDataBlock, pObjectType, update_every); |
| 1945 | } |
| 1946 | |
| 1947 | static void netdata_ad_atq_queue_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1948 | { |
| 1949 | static COUNTER_DATA atqOutstandingRequests = {.key = "ATQ Outstanding Queued Requests"}; |
| 1950 | static RRDSET *st_atq_outstanding_requests = NULL; |
| 1951 | static RRDDIM *rd_atq_outstanding_requests = NULL; |
| 1952 | |
| 1953 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &atqOutstandingRequests)) { |
| 1954 | if (unlikely(!st_atq_outstanding_requests)) { |
| 1955 | st_atq_outstanding_requests = rrdset_create_localhost( |
| 1956 | "ad", |
| 1957 | "atq_outstanding_requests", |
| 1958 | NULL, |
| 1959 | "queue", |
| 1960 | "ad.atq_outstanding_requests", |
| 1961 | "Outstanding requests", |
| 1962 | "requests", |
| 1963 | PLUGIN_WINDOWS_NAME, |
| 1964 | "PerflibAD", |
| 1965 | PRIO_AD_OUTSTANDING_REQUEST, |
| 1966 | update_every, |
| 1967 | RRDSET_TYPE_LINE); |
| 1968 | |
| 1969 | rd_atq_outstanding_requests = |
| 1970 | rrddim_add(st_atq_outstanding_requests, "outstanding", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1971 | } |
| 1972 | |
| 1973 | rrddim_set_by_pointer( |
| 1974 | st_atq_outstanding_requests, |
| 1975 | rd_atq_outstanding_requests, |
| 1976 | (collected_number)atqOutstandingRequests.current.Data); |
| 1977 | rrdset_done(st_atq_outstanding_requests); |
| 1978 | } |
| 1979 | } |
| 1980 | |
| 1981 | static void netdata_ad_atq_estimated_delay(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1982 | { |
| 1983 | static COUNTER_DATA atqEstimatedDelay = {.key = "ATQ Estimated Queue Delay"}; |
| 1984 | |
| 1985 | static RRDSET *st_atq_estimated_delay = NULL; |
| 1986 | static RRDDIM *rd_atq_estimated_delay = NULL; |
| 1987 | |
| 1988 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &atqEstimatedDelay)) |
| 1989 | return; |
| 1990 | |
| 1991 | if (unlikely(!st_atq_estimated_delay)) { |
| 1992 | st_atq_estimated_delay = rrdset_create_localhost( |
| 1993 | "ad", |
| 1994 | "atq_estimated_delay", |
| 1995 | NULL, |
| 1996 | "queue", |
| 1997 | "ad.atq_estimated_delay", |
| 1998 | "Estimated queue delay", |
| 1999 | "seconds", |
| 2000 | PLUGIN_WINDOWS_NAME, |
| 2001 | "PerflibAD", |
| 2002 | PRIO_AD_ATQ_ESTIMATED_DELAY, |
| 2003 | update_every, |
| 2004 | RRDSET_TYPE_LINE); |
| 2005 | |
| 2006 | rd_atq_estimated_delay = rrddim_add(st_atq_estimated_delay, "delay", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); |
| 2007 | } |
| 2008 | |
| 2009 | rrddim_set_by_pointer( |
| 2010 | st_atq_estimated_delay, rd_atq_estimated_delay, (collected_number)atqEstimatedDelay.current.Data); |
| 2011 | rrdset_done(st_atq_estimated_delay); |
| 2012 | } |
| 2013 | |
| 2014 | static void |
| 2015 | netdata_ad_atq_current_threads_ldap(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2016 | { |
| 2017 | static COUNTER_DATA atqThreadsLDAP = {.key = "ATQ Threads LDAP"}; |
| 2018 | static RRDSET *st_atq_current_threads_ldap = NULL; |
| 2019 | static RRDDIM *rd_atq_current_threads_ldap = NULL; |
| 2020 | |
| 2021 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &atqThreadsLDAP)) |
| 2022 | return; |
| 2023 | |
| 2024 | if (unlikely(!st_atq_current_threads_ldap)) { |
| 2025 | st_atq_current_threads_ldap = rrdset_create_localhost( |
| 2026 | "ad", |
| 2027 | "atq_current_threads_ldap", |
| 2028 | NULL, |
| 2029 | "threads", |
| 2030 | "ad.atq_current_threads_ldap", |
| 2031 | "Current ATQ LDAP threads", |
| 2032 | "threads", |
| 2033 | PLUGIN_WINDOWS_NAME, |
| 2034 | "PerflibAD", |
| 2035 | PRIO_AD_ATQ_CURRENT_THREADS_LDAP, |
| 2036 | update_every, |
| 2037 | RRDSET_TYPE_LINE); |
| 2038 | |
| 2039 | rd_atq_current_threads_ldap = |
| 2040 | rrddim_add(st_atq_current_threads_ldap, "ldap", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2041 | } |
| 2042 | |
| 2043 | rrddim_set_by_pointer( |
| 2044 | st_atq_current_threads_ldap, rd_atq_current_threads_ldap, (collected_number)atqThreadsLDAP.current.Data); |
| 2045 | rrdset_done(st_atq_current_threads_ldap); |
| 2046 | } |
| 2047 | |
| 2048 | static void |
| 2049 | netdata_ad_atq_current_threads_other(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2050 | { |
| 2051 | static COUNTER_DATA atqThreadsOther = {.key = "ATQ Threads Other"}; |
| 2052 | static RRDSET *st_atq_current_threads_other = NULL; |
| 2053 | static RRDDIM *rd_atq_current_threads_other = NULL; |
| 2054 | |
| 2055 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &atqThreadsOther)) |
| 2056 | return; |
| 2057 | |
| 2058 | if (unlikely(!st_atq_current_threads_other)) { |
| 2059 | st_atq_current_threads_other = rrdset_create_localhost( |
| 2060 | "ad", |
| 2061 | "atq_current_threads_other", |
| 2062 | NULL, |
| 2063 | "threads", |
| 2064 | "ad.atq_current_threads_other", |
| 2065 | "Current ATQ other threads", |
| 2066 | "threads", |
| 2067 | PLUGIN_WINDOWS_NAME, |
| 2068 | "PerflibAD", |
| 2069 | PRIO_AD_ATQ_CURRENT_THREADS_OTHER, |
| 2070 | update_every, |
| 2071 | RRDSET_TYPE_LINE); |
| 2072 | |
| 2073 | rd_atq_current_threads_other = |
| 2074 | rrddim_add(st_atq_current_threads_other, "other", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2075 | } |
| 2076 | |
| 2077 | rrddim_set_by_pointer( |
| 2078 | st_atq_current_threads_other, rd_atq_current_threads_other, (collected_number)atqThreadsOther.current.Data); |
| 2079 | rrdset_done(st_atq_current_threads_other); |
| 2080 | } |
| 2081 | |
| 2082 | static void |
| 2083 | netdata_ad_atq_current_threads_total(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2084 | { |
| 2085 | static COUNTER_DATA atqThreadsTotal = {.key = "ATQ Threads Total"}; |
| 2086 | static RRDSET *st_atq_current_threads_total = NULL; |
| 2087 | static RRDDIM *rd_atq_current_threads_total = NULL; |
| 2088 | |
| 2089 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &atqThreadsTotal)) |
| 2090 | return; |
| 2091 | |
| 2092 | if (unlikely(!st_atq_current_threads_total)) { |
| 2093 | st_atq_current_threads_total = rrdset_create_localhost( |
| 2094 | "ad", |
| 2095 | "atq_current_threads_total", |
| 2096 | NULL, |
| 2097 | "threads", |
| 2098 | "ad.atq_current_threads_total", |
| 2099 | "Current ATQ total threads", |
| 2100 | "threads", |
| 2101 | PLUGIN_WINDOWS_NAME, |
| 2102 | "PerflibAD", |
| 2103 | PRIO_AD_ATQ_CURRENT_THREADS_TOTAL, |
| 2104 | update_every, |
| 2105 | RRDSET_TYPE_LINE); |
| 2106 | |
| 2107 | rd_atq_current_threads_total = |
| 2108 | rrddim_add(st_atq_current_threads_total, "total", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2109 | } |
| 2110 | |
| 2111 | rrddim_set_by_pointer( |
| 2112 | st_atq_current_threads_total, rd_atq_current_threads_total, (collected_number)atqThreadsTotal.current.Data); |
| 2113 | rrdset_done(st_atq_current_threads_total); |
| 2114 | } |
| 2115 | |
| 2116 | static void netdata_ad_atq_current_threads(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2117 | { |
| 2118 | netdata_ad_atq_current_threads_ldap(pDataBlock, pObjectType, update_every); |
| 2119 | netdata_ad_atq_current_threads_other(pDataBlock, pObjectType, update_every); |
| 2120 | netdata_ad_atq_current_threads_total(pDataBlock, pObjectType, update_every); |
| 2121 | } |
| 2122 | |
| 2123 | static void netdata_ad_atq_latency(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2124 | { |
| 2125 | static COUNTER_DATA atqAverageRequestLatency = {.key = "ATQ Request Latency"}; |
| 2126 | |
| 2127 | static RRDSET *st_atq_average_request_latency = NULL; |
| 2128 | static RRDDIM *rd_atq_average_request_latency = NULL; |
| 2129 | |
| 2130 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &atqAverageRequestLatency)) |
| 2131 | return; |
| 2132 | |
| 2133 | if (unlikely(!st_atq_average_request_latency)) { |
| 2134 | st_atq_average_request_latency = rrdset_create_localhost( |
| 2135 | "ad", |
| 2136 | "atq_average_request_latency", |
| 2137 | NULL, |
| 2138 | "queue", |
| 2139 | "ad.atq_average_request_latency", |
| 2140 | "Average request processing time", |
| 2141 | "seconds", |
| 2142 | PLUGIN_WINDOWS_NAME, |
| 2143 | "PerflibAD", |
| 2144 | PRIO_AD_AVG_REQUEST_LATENCY, |
| 2145 | update_every, |
| 2146 | RRDSET_TYPE_LINE); |
| 2147 | |
| 2148 | rd_atq_average_request_latency = |
| 2149 | rrddim_add(st_atq_average_request_latency, "time", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); |
| 2150 | } |
| 2151 | |
| 2152 | rrddim_set_by_pointer( |
| 2153 | st_atq_average_request_latency, |
| 2154 | rd_atq_average_request_latency, |
| 2155 | (collected_number)atqAverageRequestLatency.current.Data); |
| 2156 | rrdset_done(st_atq_average_request_latency); |
| 2157 | } |
| 2158 | |
| 2159 | static void netdata_ad_op_total(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2160 | { |
| 2161 | static COUNTER_DATA databaseAddsPerSec = {.key = "Database adds/sec"}; |
| 2162 | static COUNTER_DATA databaseDeletesPerSec = {.key = "Database deletes/sec"}; |
| 2163 | static COUNTER_DATA databaseModifiesPerSec = {.key = "Database modifys/sec"}; |
| 2164 | static COUNTER_DATA databaseRecyclesPerSec = {.key = "Database recycles/sec"}; |
| 2165 | |
| 2166 | static RRDSET *st_database_operation_total = NULL; |
| 2167 | static RRDDIM *rd_database_operation_total_add = NULL; |
| 2168 | static RRDDIM *rd_database_operation_total_delete = NULL; |
| 2169 | static RRDDIM *rd_database_operation_total_modify = NULL; |
| 2170 | static RRDDIM *rd_database_operation_total_recycle = NULL; |
| 2171 | |
| 2172 | perflibGetObjectCounter(pDataBlock, pObjectType, &databaseAddsPerSec); |
| 2173 | perflibGetObjectCounter(pDataBlock, pObjectType, &databaseDeletesPerSec); |
| 2174 | perflibGetObjectCounter(pDataBlock, pObjectType, &databaseModifiesPerSec); |
| 2175 | perflibGetObjectCounter(pDataBlock, pObjectType, &databaseRecyclesPerSec); |
| 2176 | |
| 2177 | if (unlikely(!st_database_operation_total)) { |
| 2178 | st_database_operation_total = rrdset_create_localhost( |
| 2179 | "ad", |
| 2180 | "database_operations", |
| 2181 | NULL, |
| 2182 | "database", |
| 2183 | "ad.database_operations", |
| 2184 | "AD database operations", |
| 2185 | "operations/s", |
| 2186 | PLUGIN_WINDOWS_NAME, |
| 2187 | "PerflibAD", |
| 2188 | PRIO_AD_OPERATIONS_TOTAL, |
| 2189 | update_every, |
| 2190 | RRDSET_TYPE_LINE); |
| 2191 | |
| 2192 | rd_database_operation_total_add = |
| 2193 | rrddim_add(st_database_operation_total, "add", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2194 | |
| 2195 | rd_database_operation_total_delete = |
| 2196 | rrddim_add(st_database_operation_total, "delete", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2197 | |
| 2198 | rd_database_operation_total_modify = |
| 2199 | rrddim_add(st_database_operation_total, "modify", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2200 | |
| 2201 | rd_database_operation_total_recycle = |
| 2202 | rrddim_add(st_database_operation_total, "recycle", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2203 | } |
| 2204 | |
| 2205 | rrddim_set_by_pointer( |
| 2206 | st_database_operation_total, |
| 2207 | rd_database_operation_total_add, |
| 2208 | (collected_number)databaseAddsPerSec.current.Data); |
| 2209 | |
| 2210 | rrddim_set_by_pointer( |
| 2211 | st_database_operation_total, |
| 2212 | rd_database_operation_total_delete, |
| 2213 | (collected_number)databaseDeletesPerSec.current.Data); |
| 2214 | |
| 2215 | rrddim_set_by_pointer( |
| 2216 | st_database_operation_total, |
| 2217 | rd_database_operation_total_modify, |
| 2218 | (collected_number)databaseModifiesPerSec.current.Data); |
| 2219 | |
| 2220 | rrddim_set_by_pointer( |
| 2221 | st_database_operation_total, |
| 2222 | rd_database_operation_total_recycle, |
| 2223 | (collected_number)databaseRecyclesPerSec.current.Data); |
| 2224 | |
| 2225 | rrdset_done(st_database_operation_total); |
| 2226 | } |
| 2227 | |
| 2228 | static void netdata_ad_directory_reads(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2229 | { |
| 2230 | static COUNTER_DATA directoryReadsPerSec = {.key = "DS Directory Reads/sec"}; |
| 2231 | static RRDSET *st_directory_reads = NULL; |
| 2232 | static RRDDIM *rd_directory_reads = NULL; |
| 2233 | |
| 2234 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directoryReadsPerSec)) |
| 2235 | return; |
| 2236 | |
| 2237 | if (unlikely(!st_directory_reads)) { |
| 2238 | st_directory_reads = rrdset_create_localhost( |
| 2239 | "ad", |
| 2240 | "directory_reads", |
| 2241 | NULL, |
| 2242 | "directory", |
| 2243 | "ad.directory_reads", |
| 2244 | "Directory reads", |
| 2245 | "reads/s", |
| 2246 | PLUGIN_WINDOWS_NAME, |
| 2247 | "PerflibAD", |
| 2248 | PRIO_AD_DIRECTORY_READS, |
| 2249 | update_every, |
| 2250 | RRDSET_TYPE_LINE); |
| 2251 | |
| 2252 | rd_directory_reads = rrddim_add(st_directory_reads, "read", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2253 | } |
| 2254 | |
| 2255 | rrddim_set_by_pointer(st_directory_reads, rd_directory_reads, (collected_number)directoryReadsPerSec.current.Data); |
| 2256 | rrdset_done(st_directory_reads); |
| 2257 | } |
| 2258 | |
| 2259 | static void netdata_ad_directory_searches(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2260 | { |
| 2261 | static COUNTER_DATA directorySearchesPerSec = {.key = "DS Directory Searches/sec"}; |
| 2262 | static RRDSET *st_directory_searches = NULL; |
| 2263 | static RRDDIM *rd_directory_searches = NULL; |
| 2264 | |
| 2265 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directorySearchesPerSec)) |
| 2266 | return; |
| 2267 | |
| 2268 | if (unlikely(!st_directory_searches)) { |
| 2269 | st_directory_searches = rrdset_create_localhost( |
| 2270 | "ad", |
| 2271 | "directory_searches", |
| 2272 | NULL, |
| 2273 | "directory", |
| 2274 | "ad.directory_searches", |
| 2275 | "Directory searches", |
| 2276 | "searches/s", |
| 2277 | PLUGIN_WINDOWS_NAME, |
| 2278 | "PerflibAD", |
| 2279 | PRIO_AD_DIRECTORY_SEARCHES, |
| 2280 | update_every, |
| 2281 | RRDSET_TYPE_LINE); |
| 2282 | |
| 2283 | rd_directory_searches = rrddim_add(st_directory_searches, "search", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2284 | } |
| 2285 | |
| 2286 | rrddim_set_by_pointer( |
| 2287 | st_directory_searches, rd_directory_searches, (collected_number)directorySearchesPerSec.current.Data); |
| 2288 | rrdset_done(st_directory_searches); |
| 2289 | } |
| 2290 | |
| 2291 | static void netdata_ad_directory_writes(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2292 | { |
| 2293 | static COUNTER_DATA directoryWritesPerSec = {.key = "DS Directory Writes/sec"}; |
| 2294 | static RRDSET *st_directory_writes = NULL; |
| 2295 | static RRDDIM *rd_directory_writes = NULL; |
| 2296 | |
| 2297 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &directoryWritesPerSec)) |
| 2298 | return; |
| 2299 | |
| 2300 | if (unlikely(!st_directory_writes)) { |
| 2301 | st_directory_writes = rrdset_create_localhost( |
| 2302 | "ad", |
| 2303 | "directory_writes", |
| 2304 | NULL, |
| 2305 | "directory", |
| 2306 | "ad.directory_writes", |
| 2307 | "Directory writes", |
| 2308 | "writes/s", |
| 2309 | PLUGIN_WINDOWS_NAME, |
| 2310 | "PerflibAD", |
| 2311 | PRIO_AD_DIRECTORY_WRITES, |
| 2312 | update_every, |
| 2313 | RRDSET_TYPE_LINE); |
| 2314 | |
| 2315 | rd_directory_writes = rrddim_add(st_directory_writes, "write", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2316 | } |
| 2317 | |
| 2318 | rrddim_set_by_pointer( |
| 2319 | st_directory_writes, rd_directory_writes, (collected_number)directoryWritesPerSec.current.Data); |
| 2320 | rrdset_done(st_directory_writes); |
| 2321 | } |
| 2322 | |
| 2323 | static void netdata_ad_replication_inbound_object_updates_remaining( |
| 2324 | PERF_DATA_BLOCK *pDataBlock, |
| 2325 | PERF_OBJECT_TYPE *pObjectType, |
| 2326 | int update_every) |
| 2327 | { |
| 2328 | static COUNTER_DATA replicationInboundObjectUpdatesRemainingInPacket = { |
| 2329 | .key = "DRA Inbound Object Updates Remaining in Packet"}; |
| 2330 | static RRDSET *st_replication_inbound_object_updates_remaining = NULL; |
| 2331 | static RRDDIM *rd_replication_inbound_object_updates_remaining = NULL; |
| 2332 | |
| 2333 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundObjectUpdatesRemainingInPacket)) |
| 2334 | return; |
| 2335 | |
| 2336 | if (unlikely(!st_replication_inbound_object_updates_remaining)) { |
| 2337 | st_replication_inbound_object_updates_remaining = rrdset_create_localhost( |
| 2338 | "ad", |
| 2339 | "replication_inbound_object_updates_remaining", |
| 2340 | NULL, |
| 2341 | "replication", |
| 2342 | "ad.replication_inbound_object_updates_remaining", |
| 2343 | "Replication inbound object updates remaining", |
| 2344 | "updates", |
| 2345 | PLUGIN_WINDOWS_NAME, |
| 2346 | "PerflibAD", |
| 2347 | PRIO_AD_REPLICATION_INBOUND_OBJECT_UPDATES_REMAINING, |
| 2348 | update_every, |
| 2349 | RRDSET_TYPE_LINE); |
| 2350 | |
| 2351 | rd_replication_inbound_object_updates_remaining = rrddim_add( |
| 2352 | st_replication_inbound_object_updates_remaining, "remaining", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2353 | } |
| 2354 | |
| 2355 | rrddim_set_by_pointer( |
| 2356 | st_replication_inbound_object_updates_remaining, |
| 2357 | rd_replication_inbound_object_updates_remaining, |
| 2358 | (collected_number)replicationInboundObjectUpdatesRemainingInPacket.current.Data); |
| 2359 | rrdset_done(st_replication_inbound_object_updates_remaining); |
| 2360 | } |
| 2361 | |
| 2362 | static void netdata_ad_replication_inbound_values_dns_only( |
| 2363 | PERF_DATA_BLOCK *pDataBlock, |
| 2364 | PERF_OBJECT_TYPE *pObjectType, |
| 2365 | int update_every) |
| 2366 | { |
| 2367 | static COUNTER_DATA replicationInboundValuesDNsOnlyPerSec = {.key = "DRA Inbound Values (DNs only)/sec"}; |
| 2368 | static RRDSET *st_replication_inbound_values_dns_only = NULL; |
| 2369 | static RRDDIM *rd_replication_inbound_values_dns_only = NULL; |
| 2370 | |
| 2371 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundValuesDNsOnlyPerSec)) |
| 2372 | return; |
| 2373 | |
| 2374 | if (unlikely(!st_replication_inbound_values_dns_only)) { |
| 2375 | st_replication_inbound_values_dns_only = rrdset_create_localhost( |
| 2376 | "ad", |
| 2377 | "replication_inbound_values_dns_only", |
| 2378 | NULL, |
| 2379 | "replication", |
| 2380 | "ad.replication_inbound_values_dns_only", |
| 2381 | "DRA replication inbound values DNs only", |
| 2382 | "values/s", |
| 2383 | PLUGIN_WINDOWS_NAME, |
| 2384 | "PerflibAD", |
| 2385 | PRIO_AD_REPLICATION_INBOUND_VALUES_DNS_ONLY, |
| 2386 | update_every, |
| 2387 | RRDSET_TYPE_LINE); |
| 2388 | |
| 2389 | rd_replication_inbound_values_dns_only = |
| 2390 | rrddim_add(st_replication_inbound_values_dns_only, "dns_only", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2391 | } |
| 2392 | |
| 2393 | rrddim_set_by_pointer( |
| 2394 | st_replication_inbound_values_dns_only, |
| 2395 | rd_replication_inbound_values_dns_only, |
| 2396 | (collected_number)replicationInboundValuesDNsOnlyPerSec.current.Data); |
| 2397 | rrdset_done(st_replication_inbound_values_dns_only); |
| 2398 | } |
| 2399 | |
| 2400 | static void |
| 2401 | netdata_ad_replication_inbound_values_total(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2402 | { |
| 2403 | static COUNTER_DATA replicationInboundValuesTotalPerSec = {.key = "DRA Inbound Values Total/sec"}; |
| 2404 | static RRDSET *st_replication_inbound_values_total = NULL; |
| 2405 | static RRDDIM *rd_replication_inbound_values_total = NULL; |
| 2406 | |
| 2407 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundValuesTotalPerSec)) |
| 2408 | return; |
| 2409 | |
| 2410 | if (unlikely(!st_replication_inbound_values_total)) { |
| 2411 | st_replication_inbound_values_total = rrdset_create_localhost( |
| 2412 | "ad", |
| 2413 | "replication_inbound_values_total", |
| 2414 | NULL, |
| 2415 | "replication", |
| 2416 | "ad.replication_inbound_values_total", |
| 2417 | "DRA replication inbound values total", |
| 2418 | "values/s", |
| 2419 | PLUGIN_WINDOWS_NAME, |
| 2420 | "PerflibAD", |
| 2421 | PRIO_AD_REPLICATION_INBOUND_VALUES_TOTAL, |
| 2422 | update_every, |
| 2423 | RRDSET_TYPE_LINE); |
| 2424 | |
| 2425 | rd_replication_inbound_values_total = |
| 2426 | rrddim_add(st_replication_inbound_values_total, "total", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2427 | } |
| 2428 | |
| 2429 | rrddim_set_by_pointer( |
| 2430 | st_replication_inbound_values_total, |
| 2431 | rd_replication_inbound_values_total, |
| 2432 | (collected_number)replicationInboundValuesTotalPerSec.current.Data); |
| 2433 | rrdset_done(st_replication_inbound_values_total); |
| 2434 | } |
| 2435 | |
| 2436 | static void netdata_ad_replication_outbound_objects_filtered( |
| 2437 | PERF_DATA_BLOCK *pDataBlock, |
| 2438 | PERF_OBJECT_TYPE *pObjectType, |
| 2439 | int update_every) |
| 2440 | { |
| 2441 | static COUNTER_DATA replicationOutboundObjectsFilteredPerSec = {.key = "DRA Outbound Objects Filtered/sec"}; |
| 2442 | static RRDSET *st_replication_outbound_objects_filtered = NULL; |
| 2443 | static RRDDIM *rd_replication_outbound_objects_filtered = NULL; |
| 2444 | |
| 2445 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundObjectsFilteredPerSec)) |
| 2446 | return; |
| 2447 | |
| 2448 | if (unlikely(!st_replication_outbound_objects_filtered)) { |
| 2449 | st_replication_outbound_objects_filtered = rrdset_create_localhost( |
| 2450 | "ad", |
| 2451 | "replication_outbound_objects_filtered", |
| 2452 | NULL, |
| 2453 | "replication", |
| 2454 | "ad.replication_outbound_objects_filtered", |
| 2455 | "Replication outbound objects filtered", |
| 2456 | "objects/s", |
| 2457 | PLUGIN_WINDOWS_NAME, |
| 2458 | "PerflibAD", |
| 2459 | PRIO_AD_REPLICATION_OUTBOUND_OBJECTS_FILTERED, |
| 2460 | update_every, |
| 2461 | RRDSET_TYPE_LINE); |
| 2462 | |
| 2463 | rd_replication_outbound_objects_filtered = |
| 2464 | rrddim_add(st_replication_outbound_objects_filtered, "filtered", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2465 | } |
| 2466 | |
| 2467 | rrddim_set_by_pointer( |
| 2468 | st_replication_outbound_objects_filtered, |
| 2469 | rd_replication_outbound_objects_filtered, |
| 2470 | (collected_number)replicationOutboundObjectsFilteredPerSec.current.Data); |
| 2471 | rrdset_done(st_replication_outbound_objects_filtered); |
| 2472 | } |
| 2473 | |
| 2474 | static void |
| 2475 | netdata_ad_replication_outbound_objects(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2476 | { |
| 2477 | static COUNTER_DATA replicationOutboundObjectsPerSec = {.key = "DRA Outbound Objects/sec"}; |
| 2478 | static RRDSET *st_replication_outbound_objects = NULL; |
| 2479 | static RRDDIM *rd_replication_outbound_objects = NULL; |
| 2480 | |
| 2481 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundObjectsPerSec)) |
| 2482 | return; |
| 2483 | |
| 2484 | if (unlikely(!st_replication_outbound_objects)) { |
| 2485 | st_replication_outbound_objects = rrdset_create_localhost( |
| 2486 | "ad", |
| 2487 | "replication_outbound_objects", |
| 2488 | NULL, |
| 2489 | "replication", |
| 2490 | "ad.replication_outbound_objects", |
| 2491 | "Replication outbound objects", |
| 2492 | "objects/s", |
| 2493 | PLUGIN_WINDOWS_NAME, |
| 2494 | "PerflibAD", |
| 2495 | PRIO_AD_REPLICATION_OUTBOUND_OBJECTS, |
| 2496 | update_every, |
| 2497 | RRDSET_TYPE_LINE); |
| 2498 | |
| 2499 | rd_replication_outbound_objects = |
| 2500 | rrddim_add(st_replication_outbound_objects, "objects", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2501 | } |
| 2502 | |
| 2503 | rrddim_set_by_pointer( |
| 2504 | st_replication_outbound_objects, |
| 2505 | rd_replication_outbound_objects, |
| 2506 | (collected_number)replicationOutboundObjectsPerSec.current.Data); |
| 2507 | rrdset_done(st_replication_outbound_objects); |
| 2508 | } |
| 2509 | |
| 2510 | static void |
| 2511 | netdata_ad_replication_outbound_properties(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2512 | { |
| 2513 | static COUNTER_DATA replicationOutboundPropertiesPerSec = {.key = "DRA Outbound Properties/sec"}; |
| 2514 | static RRDSET *st_replication_outbound_properties = NULL; |
| 2515 | static RRDDIM *rd_replication_outbound_properties = NULL; |
| 2516 | |
| 2517 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundPropertiesPerSec)) |
| 2518 | return; |
| 2519 | |
| 2520 | if (unlikely(!st_replication_outbound_properties)) { |
| 2521 | st_replication_outbound_properties = rrdset_create_localhost( |
| 2522 | "ad", |
| 2523 | "replication_outbound_properties", |
| 2524 | NULL, |
| 2525 | "replication", |
| 2526 | "ad.replication_outbound_properties", |
| 2527 | "Replication outbound properties", |
| 2528 | "properties/s", |
| 2529 | PLUGIN_WINDOWS_NAME, |
| 2530 | "PerflibAD", |
| 2531 | PRIO_AD_REPLICATION_OUTBOUND_PROPERTIES, |
| 2532 | update_every, |
| 2533 | RRDSET_TYPE_LINE); |
| 2534 | |
| 2535 | rd_replication_outbound_properties = |
| 2536 | rrddim_add(st_replication_outbound_properties, "properties", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2537 | } |
| 2538 | |
| 2539 | rrddim_set_by_pointer( |
| 2540 | st_replication_outbound_properties, |
| 2541 | rd_replication_outbound_properties, |
| 2542 | (collected_number)replicationOutboundPropertiesPerSec.current.Data); |
| 2543 | rrdset_done(st_replication_outbound_properties); |
| 2544 | } |
| 2545 | |
| 2546 | static void netdata_ad_replication_outbound_values_dns_only( |
| 2547 | PERF_DATA_BLOCK *pDataBlock, |
| 2548 | PERF_OBJECT_TYPE *pObjectType, |
| 2549 | int update_every) |
| 2550 | { |
| 2551 | static COUNTER_DATA replicationOutboundValuesDNsOnlyPerSec = {.key = "DRA Outbound Values (DNs only)/sec"}; |
| 2552 | static RRDSET *st_replication_outbound_values_dns_only = NULL; |
| 2553 | static RRDDIM *rd_replication_outbound_values_dns_only = NULL; |
| 2554 | |
| 2555 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundValuesDNsOnlyPerSec)) |
| 2556 | return; |
| 2557 | |
| 2558 | if (unlikely(!st_replication_outbound_values_dns_only)) { |
| 2559 | st_replication_outbound_values_dns_only = rrdset_create_localhost( |
| 2560 | "ad", |
| 2561 | "replication_outbound_values_dns_only", |
| 2562 | NULL, |
| 2563 | "replication", |
| 2564 | "ad.replication_outbound_values_dns_only", |
| 2565 | "DRA replication outbound values DNs only", |
| 2566 | "values/s", |
| 2567 | PLUGIN_WINDOWS_NAME, |
| 2568 | "PerflibAD", |
| 2569 | PRIO_AD_REPLICATION_OUTBOUND_VALUES_DNS_ONLY, |
| 2570 | update_every, |
| 2571 | RRDSET_TYPE_LINE); |
| 2572 | |
| 2573 | rd_replication_outbound_values_dns_only = |
| 2574 | rrddim_add(st_replication_outbound_values_dns_only, "dns_only", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2575 | } |
| 2576 | |
| 2577 | rrddim_set_by_pointer( |
| 2578 | st_replication_outbound_values_dns_only, |
| 2579 | rd_replication_outbound_values_dns_only, |
| 2580 | (collected_number)replicationOutboundValuesDNsOnlyPerSec.current.Data); |
| 2581 | rrdset_done(st_replication_outbound_values_dns_only); |
| 2582 | } |
| 2583 | |
| 2584 | static void netdata_ad_replication_outbound_values_total( |
| 2585 | PERF_DATA_BLOCK *pDataBlock, |
| 2586 | PERF_OBJECT_TYPE *pObjectType, |
| 2587 | int update_every) |
| 2588 | { |
| 2589 | static COUNTER_DATA replicationOutboundValuesTotalPerSec = {.key = "DRA Outbound Values Total/sec"}; |
| 2590 | static RRDSET *st_replication_outbound_values_total = NULL; |
| 2591 | static RRDDIM *rd_replication_outbound_values_total = NULL; |
| 2592 | |
| 2593 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundValuesTotalPerSec)) |
| 2594 | return; |
| 2595 | |
| 2596 | if (unlikely(!st_replication_outbound_values_total)) { |
| 2597 | st_replication_outbound_values_total = rrdset_create_localhost( |
| 2598 | "ad", |
| 2599 | "replication_outbound_values_total", |
| 2600 | NULL, |
| 2601 | "replication", |
| 2602 | "ad.replication_outbound_values_total", |
| 2603 | "DRA replication outbound values total", |
| 2604 | "values/s", |
| 2605 | PLUGIN_WINDOWS_NAME, |
| 2606 | "PerflibAD", |
| 2607 | PRIO_AD_REPLICATION_OUTBOUND_VALUES_TOTAL, |
| 2608 | update_every, |
| 2609 | RRDSET_TYPE_LINE); |
| 2610 | |
| 2611 | rd_replication_outbound_values_total = |
| 2612 | rrddim_add(st_replication_outbound_values_total, "total", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2613 | } |
| 2614 | |
| 2615 | rrddim_set_by_pointer( |
| 2616 | st_replication_outbound_values_total, |
| 2617 | rd_replication_outbound_values_total, |
| 2618 | (collected_number)replicationOutboundValuesTotalPerSec.current.Data); |
| 2619 | rrdset_done(st_replication_outbound_values_total); |
| 2620 | } |
| 2621 | |
| 2622 | static void netdata_ad_replication_threads_getting_nc_changes( |
| 2623 | PERF_DATA_BLOCK *pDataBlock, |
| 2624 | PERF_OBJECT_TYPE *pObjectType, |
| 2625 | int update_every) |
| 2626 | { |
| 2627 | static COUNTER_DATA draThreadsGettingNCChanges = {.key = "DRA Threads Getting NC Changes"}; |
| 2628 | static RRDSET *st_replication_threads_getting_nc_changes = NULL; |
| 2629 | static RRDDIM *rd_replication_threads_getting_nc_changes = NULL; |
| 2630 | |
| 2631 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &draThreadsGettingNCChanges)) |
| 2632 | return; |
| 2633 | |
| 2634 | if (unlikely(!st_replication_threads_getting_nc_changes)) { |
| 2635 | st_replication_threads_getting_nc_changes = rrdset_create_localhost( |
| 2636 | "ad", |
| 2637 | "replication_threads_getting_nc_changes", |
| 2638 | NULL, |
| 2639 | "replication", |
| 2640 | "ad.replication_threads_getting_nc_changes", |
| 2641 | "DRA threads getting NC changes", |
| 2642 | "threads", |
| 2643 | PLUGIN_WINDOWS_NAME, |
| 2644 | "PerflibAD", |
| 2645 | PRIO_AD_REPLICATION_THREADS_GETTING_NC_CHANGES, |
| 2646 | update_every, |
| 2647 | RRDSET_TYPE_LINE); |
| 2648 | |
| 2649 | rd_replication_threads_getting_nc_changes = |
| 2650 | rrddim_add(st_replication_threads_getting_nc_changes, "threads", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2651 | } |
| 2652 | |
| 2653 | rrddim_set_by_pointer( |
| 2654 | st_replication_threads_getting_nc_changes, |
| 2655 | rd_replication_threads_getting_nc_changes, |
| 2656 | (collected_number)draThreadsGettingNCChanges.current.Data); |
| 2657 | rrdset_done(st_replication_threads_getting_nc_changes); |
| 2658 | } |
| 2659 | |
| 2660 | static void netdata_ad_replication_threads_getting_nc_changes_holding_semaphore( |
| 2661 | PERF_DATA_BLOCK *pDataBlock, |
| 2662 | PERF_OBJECT_TYPE *pObjectType, |
| 2663 | int update_every) |
| 2664 | { |
| 2665 | static COUNTER_DATA draThreadsGettingNCChangesHoldingSemaphore = { |
| 2666 | .key = "DRA Threads Getting NC Changes Holding Semaphore"}; |
| 2667 | static RRDSET *st_replication_threads_getting_nc_changes_holding_semaphore = NULL; |
| 2668 | static RRDDIM *rd_replication_threads_getting_nc_changes_holding_semaphore = NULL; |
| 2669 | |
| 2670 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &draThreadsGettingNCChangesHoldingSemaphore)) |
| 2671 | return; |
| 2672 | |
| 2673 | if (unlikely(!st_replication_threads_getting_nc_changes_holding_semaphore)) { |
| 2674 | st_replication_threads_getting_nc_changes_holding_semaphore = rrdset_create_localhost( |
| 2675 | "ad", |
| 2676 | "replication_threads_getting_nc_changes_holding_semaphore", |
| 2677 | NULL, |
| 2678 | "replication", |
| 2679 | "ad.replication_threads_getting_nc_changes_holding_semaphore", |
| 2680 | "DRA threads getting NC changes holding semaphore", |
| 2681 | "threads", |
| 2682 | PLUGIN_WINDOWS_NAME, |
| 2683 | "PerflibAD", |
| 2684 | PRIO_AD_REPLICATION_THREADS_GETTING_NC_CHANGES_HOLDING_SEMAPHORE, |
| 2685 | update_every, |
| 2686 | RRDSET_TYPE_LINE); |
| 2687 | |
| 2688 | rd_replication_threads_getting_nc_changes_holding_semaphore = rrddim_add( |
| 2689 | st_replication_threads_getting_nc_changes_holding_semaphore, "threads", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2690 | } |
| 2691 | |
| 2692 | rrddim_set_by_pointer( |
| 2693 | st_replication_threads_getting_nc_changes_holding_semaphore, |
| 2694 | rd_replication_threads_getting_nc_changes_holding_semaphore, |
| 2695 | (collected_number)draThreadsGettingNCChangesHoldingSemaphore.current.Data); |
| 2696 | rrdset_done(st_replication_threads_getting_nc_changes_holding_semaphore); |
| 2697 | } |
| 2698 | |
| 2699 | static void |
| 2700 | netdata_ad_transitive_operations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2701 | { |
| 2702 | static COUNTER_DATA transitiveOperationsPerSec = {.key = "Transitive operations/sec"}; |
| 2703 | static RRDSET *st_transitive_operations = NULL; |
| 2704 | static RRDDIM *rd_transitive_operations = NULL; |
| 2705 | |
| 2706 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &transitiveOperationsPerSec)) |
| 2707 | return; |
| 2708 | |
| 2709 | if (unlikely(!st_transitive_operations)) { |
| 2710 | st_transitive_operations = rrdset_create_localhost( |
| 2711 | "ad", |
| 2712 | "transitive_operations", |
| 2713 | NULL, |
| 2714 | "database", |
| 2715 | "ad.transitive_operations", |
| 2716 | "Transitive operations", |
| 2717 | "operations/s", |
| 2718 | PLUGIN_WINDOWS_NAME, |
| 2719 | "PerflibAD", |
| 2720 | PRIO_AD_TRANSITIVE_OPERATIONS, |
| 2721 | update_every, |
| 2722 | RRDSET_TYPE_LINE); |
| 2723 | |
| 2724 | rd_transitive_operations = |
| 2725 | rrddim_add(st_transitive_operations, "operations", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2726 | } |
| 2727 | |
| 2728 | rrddim_set_by_pointer( |
| 2729 | st_transitive_operations, rd_transitive_operations, (collected_number)transitiveOperationsPerSec.current.Data); |
| 2730 | rrdset_done(st_transitive_operations); |
| 2731 | } |
| 2732 | |
| 2733 | static void |
| 2734 | netdata_ad_transitive_suboperations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2735 | { |
| 2736 | static COUNTER_DATA transitiveSubOperationsPerSec = {.key = "Transitive suboperations/sec"}; |
| 2737 | static RRDSET *st_transitive_suboperations = NULL; |
| 2738 | static RRDDIM *rd_transitive_suboperations = NULL; |
| 2739 | |
| 2740 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &transitiveSubOperationsPerSec)) |
| 2741 | return; |
| 2742 | |
| 2743 | if (unlikely(!st_transitive_suboperations)) { |
| 2744 | st_transitive_suboperations = rrdset_create_localhost( |
| 2745 | "ad", |
| 2746 | "transitive_suboperations", |
| 2747 | NULL, |
| 2748 | "database", |
| 2749 | "ad.transitive_suboperations", |
| 2750 | "Transitive suboperations", |
| 2751 | "suboperations/s", |
| 2752 | PLUGIN_WINDOWS_NAME, |
| 2753 | "PerflibAD", |
| 2754 | PRIO_AD_TRANSITIVE_SUBOPERATIONS, |
| 2755 | update_every, |
| 2756 | RRDSET_TYPE_LINE); |
| 2757 | |
| 2758 | rd_transitive_suboperations = |
| 2759 | rrddim_add(st_transitive_suboperations, "suboperations", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2760 | } |
| 2761 | |
| 2762 | rrddim_set_by_pointer( |
| 2763 | st_transitive_suboperations, |
| 2764 | rd_transitive_suboperations, |
| 2765 | (collected_number)transitiveSubOperationsPerSec.current.Data); |
| 2766 | rrdset_done(st_transitive_suboperations); |
| 2767 | } |
| 2768 | |
| 2769 | static void |
| 2770 | netdata_ad_replication_inbound_bytes_total(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2771 | { |
| 2772 | static COUNTER_DATA replicationInboundBytesTotalPerSec = {.key = "DRA Inbound Bytes Total/sec"}; |
| 2773 | static RRDSET *st_replication_inbound_bytes_total = NULL; |
| 2774 | static RRDDIM *rd_replication_inbound_bytes_total = NULL; |
| 2775 | |
| 2776 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationInboundBytesTotalPerSec)) |
| 2777 | return; |
| 2778 | |
| 2779 | if (unlikely(!st_replication_inbound_bytes_total)) { |
| 2780 | st_replication_inbound_bytes_total = rrdset_create_localhost( |
| 2781 | "ad", |
| 2782 | "replication_inbound_bytes_total", |
| 2783 | NULL, |
| 2784 | "replication", |
| 2785 | "ad.replication_inbound_bytes_total", |
| 2786 | "DRA replication inbound bytes total", |
| 2787 | "bytes/s", |
| 2788 | PLUGIN_WINDOWS_NAME, |
| 2789 | "PerflibAD", |
| 2790 | PRIO_AD_REPLICATION_INBOUND_BYTES_TOTAL, |
| 2791 | update_every, |
| 2792 | RRDSET_TYPE_LINE); |
| 2793 | |
| 2794 | rd_replication_inbound_bytes_total = |
| 2795 | rrddim_add(st_replication_inbound_bytes_total, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2796 | } |
| 2797 | |
| 2798 | rrddim_set_by_pointer( |
| 2799 | st_replication_inbound_bytes_total, |
| 2800 | rd_replication_inbound_bytes_total, |
| 2801 | (collected_number)replicationInboundBytesTotalPerSec.current.Data); |
| 2802 | rrdset_done(st_replication_inbound_bytes_total); |
| 2803 | } |
| 2804 | |
| 2805 | static void |
| 2806 | netdata_ad_replication_outbound_bytes_total(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2807 | { |
| 2808 | static COUNTER_DATA replicationOutboundBytesTotalPerSec = {.key = "DRA Outbound Bytes Total/sec"}; |
| 2809 | static RRDSET *st_replication_outbound_bytes_total = NULL; |
| 2810 | static RRDDIM *rd_replication_outbound_bytes_total = NULL; |
| 2811 | |
| 2812 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &replicationOutboundBytesTotalPerSec)) |
| 2813 | return; |
| 2814 | |
| 2815 | if (unlikely(!st_replication_outbound_bytes_total)) { |
| 2816 | st_replication_outbound_bytes_total = rrdset_create_localhost( |
| 2817 | "ad", |
| 2818 | "replication_outbound_bytes_total", |
| 2819 | NULL, |
| 2820 | "replication", |
| 2821 | "ad.replication_outbound_bytes_total", |
| 2822 | "DRA replication outbound bytes total", |
| 2823 | "bytes/s", |
| 2824 | PLUGIN_WINDOWS_NAME, |
| 2825 | "PerflibAD", |
| 2826 | PRIO_AD_REPLICATION_OUTBOUND_BYTES_TOTAL, |
| 2827 | update_every, |
| 2828 | RRDSET_TYPE_LINE); |
| 2829 | |
| 2830 | rd_replication_outbound_bytes_total = |
| 2831 | rrddim_add(st_replication_outbound_bytes_total, "outbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2832 | } |
| 2833 | |
| 2834 | rrddim_set_by_pointer( |
| 2835 | st_replication_outbound_bytes_total, |
| 2836 | rd_replication_outbound_bytes_total, |
| 2837 | (collected_number)replicationOutboundBytesTotalPerSec.current.Data); |
| 2838 | rrdset_done(st_replication_outbound_bytes_total); |
| 2839 | } |
| 2840 | |
| 2841 | static void |
| 2842 | netdata_ad_ldap_closed_connections(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2843 | { |
| 2844 | static COUNTER_DATA ldapClosedConnectionsPerSec = {.key = "LDAP Closed Connections/sec"}; |
| 2845 | static RRDSET *st_ldap_closed_connections_total = NULL; |
| 2846 | static RRDDIM *rd_ldap_closed_connections_total = NULL; |
| 2847 | |
| 2848 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapClosedConnectionsPerSec)) |
| 2849 | return; |
| 2850 | |
| 2851 | if (unlikely(!st_ldap_closed_connections_total)) { |
| 2852 | st_ldap_closed_connections_total = rrdset_create_localhost( |
| 2853 | "ad", |
| 2854 | "ldap_closed_connections", |
| 2855 | NULL, |
| 2856 | "ldap", |
| 2857 | "ad.ldap_closed_connections", |
| 2858 | "LDAP closed connections", |
| 2859 | "connections/s", |
| 2860 | PLUGIN_WINDOWS_NAME, |
| 2861 | "PerflibAD", |
| 2862 | PRIO_AD_LDAP_CLOSED_CONNECTIONS_TOTAL, |
| 2863 | update_every, |
| 2864 | RRDSET_TYPE_LINE); |
| 2865 | |
| 2866 | rd_ldap_closed_connections_total = |
| 2867 | rrddim_add(st_ldap_closed_connections_total, "closed", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2868 | } |
| 2869 | |
| 2870 | rrddim_set_by_pointer( |
| 2871 | st_ldap_closed_connections_total, |
| 2872 | rd_ldap_closed_connections_total, |
| 2873 | (collected_number)ldapClosedConnectionsPerSec.current.Data); |
| 2874 | rrdset_done(st_ldap_closed_connections_total); |
| 2875 | } |
| 2876 | |
| 2877 | static void |
| 2878 | netdata_ad_ldap_opened_connections_ldap(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2879 | { |
| 2880 | static COUNTER_DATA ldapNewConnectionsPerSec = {.key = "LDAP New Connections/sec"}; |
| 2881 | static RRDSET *st_ldap_opened_connections_ldap = NULL; |
| 2882 | static RRDDIM *rd_ldap_opened_connections_ldap = NULL; |
| 2883 | |
| 2884 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapNewConnectionsPerSec)) |
| 2885 | return; |
| 2886 | |
| 2887 | if (unlikely(!st_ldap_opened_connections_ldap)) { |
| 2888 | st_ldap_opened_connections_ldap = rrdset_create_localhost( |
| 2889 | "ad", |
| 2890 | "ldap_opened_connections_ldap", |
| 2891 | NULL, |
| 2892 | "ldap", |
| 2893 | "ad.ldap_opened_connections_ldap", |
| 2894 | "LDAP opened connections", |
| 2895 | "connections/s", |
| 2896 | PLUGIN_WINDOWS_NAME, |
| 2897 | "PerflibAD", |
| 2898 | PRIO_AD_LDAP_OPENED_CONNECTIONS_LDAP, |
| 2899 | update_every, |
| 2900 | RRDSET_TYPE_LINE); |
| 2901 | |
| 2902 | rd_ldap_opened_connections_ldap = |
| 2903 | rrddim_add(st_ldap_opened_connections_ldap, "ldap", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2904 | } |
| 2905 | |
| 2906 | rrddim_set_by_pointer( |
| 2907 | st_ldap_opened_connections_ldap, |
| 2908 | rd_ldap_opened_connections_ldap, |
| 2909 | (collected_number)ldapNewConnectionsPerSec.current.Data); |
| 2910 | rrdset_done(st_ldap_opened_connections_ldap); |
| 2911 | } |
| 2912 | |
| 2913 | static void |
| 2914 | netdata_ad_ldap_opened_connections_ldaps(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2915 | { |
| 2916 | static COUNTER_DATA ldapNewSSLConnectionsPerSec = {.key = "LDAP New SSL Connections/sec"}; |
| 2917 | static RRDSET *st_ldap_opened_connections_ldaps = NULL; |
| 2918 | static RRDDIM *rd_ldap_opened_connections_ldaps = NULL; |
| 2919 | |
| 2920 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapNewSSLConnectionsPerSec)) |
| 2921 | return; |
| 2922 | |
| 2923 | if (unlikely(!st_ldap_opened_connections_ldaps)) { |
| 2924 | st_ldap_opened_connections_ldaps = rrdset_create_localhost( |
| 2925 | "ad", |
| 2926 | "ldap_opened_connections_ldaps", |
| 2927 | NULL, |
| 2928 | "ldap", |
| 2929 | "ad.ldap_opened_connections_ldaps", |
| 2930 | "LDAPS opened connections", |
| 2931 | "connections/s", |
| 2932 | PLUGIN_WINDOWS_NAME, |
| 2933 | "PerflibAD", |
| 2934 | PRIO_AD_LDAP_OPENED_CONNECTIONS_LDAPS, |
| 2935 | update_every, |
| 2936 | RRDSET_TYPE_LINE); |
| 2937 | |
| 2938 | rd_ldap_opened_connections_ldaps = |
| 2939 | rrddim_add(st_ldap_opened_connections_ldaps, "ldaps", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 2940 | } |
| 2941 | |
| 2942 | rrddim_set_by_pointer( |
| 2943 | st_ldap_opened_connections_ldaps, |
| 2944 | rd_ldap_opened_connections_ldaps, |
| 2945 | (collected_number)ldapNewSSLConnectionsPerSec.current.Data); |
| 2946 | rrdset_done(st_ldap_opened_connections_ldaps); |
| 2947 | } |
| 2948 | |
| 2949 | static void netdata_ad_ldap_active_threads(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2950 | { |
| 2951 | static COUNTER_DATA ldapActiveThreads = {.key = "LDAP Active Threads"}; |
| 2952 | static RRDSET *st_ldap_active_threads = NULL; |
| 2953 | static RRDDIM *rd_ldap_active_threads = NULL; |
| 2954 | |
| 2955 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapActiveThreads)) |
| 2956 | return; |
| 2957 | |
| 2958 | if (unlikely(!st_ldap_active_threads)) { |
| 2959 | st_ldap_active_threads = rrdset_create_localhost( |
| 2960 | "ad", |
| 2961 | "ldap_active_threads", |
| 2962 | NULL, |
| 2963 | "threads", |
| 2964 | "ad.ldap_active_threads", |
| 2965 | "LDAP active threads", |
| 2966 | "threads", |
| 2967 | PLUGIN_WINDOWS_NAME, |
| 2968 | "PerflibAD", |
| 2969 | PRIO_AD_LDAP_ACTIVE_THREADS, |
| 2970 | update_every, |
| 2971 | RRDSET_TYPE_LINE); |
| 2972 | |
| 2973 | rd_ldap_active_threads = rrddim_add(st_ldap_active_threads, "active", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 2974 | } |
| 2975 | |
| 2976 | rrddim_set_by_pointer( |
| 2977 | st_ldap_active_threads, rd_ldap_active_threads, (collected_number)ldapActiveThreads.current.Data); |
| 2978 | rrdset_done(st_ldap_active_threads); |
| 2979 | } |
| 2980 | |
| 2981 | static void netdata_ad_ldap_udp_operations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 2982 | { |
| 2983 | static COUNTER_DATA ldapUDPOperationsPerSec = {.key = "LDAP UDP operations/sec"}; |
| 2984 | static RRDSET *st_ldap_udp_operations_total = NULL; |
| 2985 | static RRDDIM *rd_ldap_udp_operations_total = NULL; |
| 2986 | |
| 2987 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapUDPOperationsPerSec)) |
| 2988 | return; |
| 2989 | |
| 2990 | if (unlikely(!st_ldap_udp_operations_total)) { |
| 2991 | st_ldap_udp_operations_total = rrdset_create_localhost( |
| 2992 | "ad", |
| 2993 | "ldap_udp_operations", |
| 2994 | NULL, |
| 2995 | "ldap", |
| 2996 | "ad.ldap_udp_operations", |
| 2997 | "LDAP UDP operations", |
| 2998 | "operations/s", |
| 2999 | PLUGIN_WINDOWS_NAME, |
| 3000 | "PerflibAD", |
| 3001 | PRIO_AD_LDAP_UDP_OPERATIONS_TOTAL, |
| 3002 | update_every, |
| 3003 | RRDSET_TYPE_LINE); |
| 3004 | |
| 3005 | rd_ldap_udp_operations_total = |
| 3006 | rrddim_add(st_ldap_udp_operations_total, "udp", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3007 | } |
| 3008 | |
| 3009 | rrddim_set_by_pointer( |
| 3010 | st_ldap_udp_operations_total, |
| 3011 | rd_ldap_udp_operations_total, |
| 3012 | (collected_number)ldapUDPOperationsPerSec.current.Data); |
| 3013 | rrdset_done(st_ldap_udp_operations_total); |
| 3014 | } |
| 3015 | |
| 3016 | static void netdata_ad_ldap_writes(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3017 | { |
| 3018 | static COUNTER_DATA ldapWritesPerSec = {.key = "LDAP Writes/sec"}; |
| 3019 | static RRDSET *st_ldap_writes_total = NULL; |
| 3020 | static RRDDIM *rd_ldap_writes_total = NULL; |
| 3021 | |
| 3022 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapWritesPerSec)) |
| 3023 | return; |
| 3024 | |
| 3025 | if (unlikely(!st_ldap_writes_total)) { |
| 3026 | st_ldap_writes_total = rrdset_create_localhost( |
| 3027 | "ad", |
| 3028 | "ldap_writes", |
| 3029 | NULL, |
| 3030 | "ldap", |
| 3031 | "ad.ldap_writes", |
| 3032 | "LDAP writes", |
| 3033 | "writes/s", |
| 3034 | PLUGIN_WINDOWS_NAME, |
| 3035 | "PerflibAD", |
| 3036 | PRIO_AD_LDAP_WRITES_TOTAL, |
| 3037 | update_every, |
| 3038 | RRDSET_TYPE_LINE); |
| 3039 | |
| 3040 | rd_ldap_writes_total = rrddim_add(st_ldap_writes_total, "writes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3041 | } |
| 3042 | |
| 3043 | rrddim_set_by_pointer(st_ldap_writes_total, rd_ldap_writes_total, (collected_number)ldapWritesPerSec.current.Data); |
| 3044 | rrdset_done(st_ldap_writes_total); |
| 3045 | } |
| 3046 | |
| 3047 | static void |
| 3048 | netdata_ad_ldap_client_sessions(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3049 | { |
| 3050 | static COUNTER_DATA ldapClientSessions = {.key = "LDAP Client Sessions"}; |
| 3051 | static RRDSET *st_ldap_client_sessions = NULL; |
| 3052 | static RRDDIM *rd_ldap_client_sessions = NULL; |
| 3053 | |
| 3054 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &ldapClientSessions)) |
| 3055 | return; |
| 3056 | |
| 3057 | if (unlikely(!st_ldap_client_sessions)) { |
| 3058 | st_ldap_client_sessions = rrdset_create_localhost( |
| 3059 | "ad", |
| 3060 | "ldap_client_sessions", |
| 3061 | NULL, |
| 3062 | "ldap", |
| 3063 | "ad.ldap_client_sessions", |
| 3064 | "LDAP client sessions", |
| 3065 | "sessions", |
| 3066 | PLUGIN_WINDOWS_NAME, |
| 3067 | "PerflibAD", |
| 3068 | PRIO_AD_LDAP_CLIENT_SESSIONS, |
| 3069 | update_every, |
| 3070 | RRDSET_TYPE_LINE); |
| 3071 | |
| 3072 | rd_ldap_client_sessions = rrddim_add(st_ldap_client_sessions, "sessions", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 3073 | } |
| 3074 | |
| 3075 | rrddim_set_by_pointer( |
| 3076 | st_ldap_client_sessions, rd_ldap_client_sessions, (collected_number)ldapClientSessions.current.Data); |
| 3077 | rrdset_done(st_ldap_client_sessions); |
| 3078 | } |
| 3079 | |
| 3080 | static void netdata_ad_ldap(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3081 | { |
| 3082 | netdata_ad_ldap_closed_connections(pDataBlock, pObjectType, update_every); |
| 3083 | netdata_ad_ldap_opened_connections_ldap(pDataBlock, pObjectType, update_every); |
| 3084 | netdata_ad_ldap_opened_connections_ldaps(pDataBlock, pObjectType, update_every); |
| 3085 | netdata_ad_ldap_active_threads(pDataBlock, pObjectType, update_every); |
| 3086 | netdata_ad_ldap_udp_operations(pDataBlock, pObjectType, update_every); |
| 3087 | netdata_ad_ldap_writes(pDataBlock, pObjectType, update_every); |
| 3088 | netdata_ad_ldap_client_sessions(pDataBlock, pObjectType, update_every); |
| 3089 | } |
| 3090 | |
| 3091 | static void |
| 3092 | netdata_ad_cleanup_link_values_cleaned(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3093 | { |
| 3094 | static COUNTER_DATA linkValuesCleanedPerSec = {.key = "Link Values Cleaned/sec"}; |
| 3095 | static RRDSET *st_link_values_cleaned_total = NULL; |
| 3096 | static RRDDIM *rd_link_values_cleaned_total = NULL; |
| 3097 | |
| 3098 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &linkValuesCleanedPerSec)) |
| 3099 | return; |
| 3100 | |
| 3101 | if (unlikely(!st_link_values_cleaned_total)) { |
| 3102 | st_link_values_cleaned_total = rrdset_create_localhost( |
| 3103 | "ad", |
| 3104 | "link_values_cleaned", |
| 3105 | NULL, |
| 3106 | "cleanup", |
| 3107 | "ad.link_values_cleaned", |
| 3108 | "Link values cleaned", |
| 3109 | "values/s", |
| 3110 | PLUGIN_WINDOWS_NAME, |
| 3111 | "PerflibAD", |
| 3112 | PRIO_AD_LINK_VALUES_CLEANED_TOTAL, |
| 3113 | update_every, |
| 3114 | RRDSET_TYPE_LINE); |
| 3115 | |
| 3116 | rd_link_values_cleaned_total = |
| 3117 | rrddim_add(st_link_values_cleaned_total, "cleaned", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3118 | } |
| 3119 | |
| 3120 | rrddim_set_by_pointer( |
| 3121 | st_link_values_cleaned_total, |
| 3122 | rd_link_values_cleaned_total, |
| 3123 | (collected_number)linkValuesCleanedPerSec.current.Data); |
| 3124 | rrdset_done(st_link_values_cleaned_total); |
| 3125 | } |
| 3126 | |
| 3127 | static void |
| 3128 | netdata_ad_cleanup_phantom_objects_cleaned(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3129 | { |
| 3130 | static COUNTER_DATA phantomsCleanedPerSec = {.key = "Phantoms Cleaned/sec"}; |
| 3131 | static RRDSET *st_phantom_objects_cleaned_total = NULL; |
| 3132 | static RRDDIM *rd_phantom_objects_cleaned_total = NULL; |
| 3133 | |
| 3134 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &phantomsCleanedPerSec)) |
| 3135 | return; |
| 3136 | |
| 3137 | if (unlikely(!st_phantom_objects_cleaned_total)) { |
| 3138 | st_phantom_objects_cleaned_total = rrdset_create_localhost( |
| 3139 | "ad", |
| 3140 | "phantom_objects_cleaned", |
| 3141 | NULL, |
| 3142 | "cleanup", |
| 3143 | "ad.phantom_objects_cleaned", |
| 3144 | "Phantom objects cleaned", |
| 3145 | "objects/s", |
| 3146 | PLUGIN_WINDOWS_NAME, |
| 3147 | "PerflibAD", |
| 3148 | PRIO_AD_PHANTOM_OBJECTS_CLEANED_TOTAL, |
| 3149 | update_every, |
| 3150 | RRDSET_TYPE_LINE); |
| 3151 | |
| 3152 | rd_phantom_objects_cleaned_total = |
| 3153 | rrddim_add(st_phantom_objects_cleaned_total, "cleaned", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3154 | } |
| 3155 | |
| 3156 | rrddim_set_by_pointer( |
| 3157 | st_phantom_objects_cleaned_total, |
| 3158 | rd_phantom_objects_cleaned_total, |
| 3159 | (collected_number)phantomsCleanedPerSec.current.Data); |
| 3160 | rrdset_done(st_phantom_objects_cleaned_total); |
| 3161 | } |
| 3162 | |
| 3163 | static void |
| 3164 | netdata_ad_cleanup_phantom_objects_visited(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3165 | { |
| 3166 | static COUNTER_DATA phantomsVisitedPerSec = {.key = "Phantoms Visited/sec"}; |
| 3167 | static RRDSET *st_phantom_objects_visited_total = NULL; |
| 3168 | static RRDDIM *rd_phantom_objects_visited_total = NULL; |
| 3169 | |
| 3170 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &phantomsVisitedPerSec)) |
| 3171 | return; |
| 3172 | |
| 3173 | if (unlikely(!st_phantom_objects_visited_total)) { |
| 3174 | st_phantom_objects_visited_total = rrdset_create_localhost( |
| 3175 | "ad", |
| 3176 | "phantom_objects_visited", |
| 3177 | NULL, |
| 3178 | "cleanup", |
| 3179 | "ad.phantom_objects_visited", |
| 3180 | "Phantom objects visited", |
| 3181 | "objects/s", |
| 3182 | PLUGIN_WINDOWS_NAME, |
| 3183 | "PerflibAD", |
| 3184 | PRIO_AD_PHANTOM_OBJECTS_VISITED_TOTAL, |
| 3185 | update_every, |
| 3186 | RRDSET_TYPE_LINE); |
| 3187 | |
| 3188 | rd_phantom_objects_visited_total = |
| 3189 | rrddim_add(st_phantom_objects_visited_total, "visited", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3190 | } |
| 3191 | |
| 3192 | rrddim_set_by_pointer( |
| 3193 | st_phantom_objects_visited_total, |
| 3194 | rd_phantom_objects_visited_total, |
| 3195 | (collected_number)phantomsVisitedPerSec.current.Data); |
| 3196 | rrdset_done(st_phantom_objects_visited_total); |
| 3197 | } |
| 3198 | |
| 3199 | static void netdata_ad_cleanup_tombstoned_objects_collected( |
| 3200 | PERF_DATA_BLOCK *pDataBlock, |
| 3201 | PERF_OBJECT_TYPE *pObjectType, |
| 3202 | int update_every) |
| 3203 | { |
| 3204 | static COUNTER_DATA tombstonesGarbageCollectedPerSec = {.key = "Tombstones Garbage Collected/sec"}; |
| 3205 | static RRDSET *st_tombstoned_objects_collected_total = NULL; |
| 3206 | static RRDDIM *rd_tombstoned_objects_collected_total = NULL; |
| 3207 | |
| 3208 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &tombstonesGarbageCollectedPerSec)) |
| 3209 | return; |
| 3210 | |
| 3211 | if (unlikely(!st_tombstoned_objects_collected_total)) { |
| 3212 | st_tombstoned_objects_collected_total = rrdset_create_localhost( |
| 3213 | "ad", |
| 3214 | "tombstoned_objects_collected", |
| 3215 | NULL, |
| 3216 | "cleanup", |
| 3217 | "ad.tombstoned_objects_collected", |
| 3218 | "Tombstoned objects collected", |
| 3219 | "objects/s", |
| 3220 | PLUGIN_WINDOWS_NAME, |
| 3221 | "PerflibAD", |
| 3222 | PRIO_AD_TOMBSTONED_OBJECTS_COLLECTED_TOTAL, |
| 3223 | update_every, |
| 3224 | RRDSET_TYPE_LINE); |
| 3225 | |
| 3226 | rd_tombstoned_objects_collected_total = |
| 3227 | rrddim_add(st_tombstoned_objects_collected_total, "collected", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3228 | } |
| 3229 | |
| 3230 | rrddim_set_by_pointer( |
| 3231 | st_tombstoned_objects_collected_total, |
| 3232 | rd_tombstoned_objects_collected_total, |
| 3233 | (collected_number)tombstonesGarbageCollectedPerSec.current.Data); |
| 3234 | rrdset_done(st_tombstoned_objects_collected_total); |
| 3235 | } |
| 3236 | |
| 3237 | static void netdata_ad_cleanup_tombstoned_objects_visited( |
| 3238 | PERF_DATA_BLOCK *pDataBlock, |
| 3239 | PERF_OBJECT_TYPE *pObjectType, |
| 3240 | int update_every) |
| 3241 | { |
| 3242 | static COUNTER_DATA tombstonesVisitedPerSec = {.key = "Tombstones Visited/sec"}; |
| 3243 | static RRDSET *st_tombstoned_objects_visited_total = NULL; |
| 3244 | static RRDDIM *rd_tombstoned_objects_visited_total = NULL; |
| 3245 | |
| 3246 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &tombstonesVisitedPerSec)) |
| 3247 | return; |
| 3248 | |
| 3249 | if (unlikely(!st_tombstoned_objects_visited_total)) { |
| 3250 | st_tombstoned_objects_visited_total = rrdset_create_localhost( |
| 3251 | "ad", |
| 3252 | "tombstoned_objects_visited", |
| 3253 | NULL, |
| 3254 | "cleanup", |
| 3255 | "ad.tombstoned_objects_visited", |
| 3256 | "Tombstoned objects visited", |
| 3257 | "objects/s", |
| 3258 | PLUGIN_WINDOWS_NAME, |
| 3259 | "PerflibAD", |
| 3260 | PRIO_AD_TOMBSTONED_OBJECTS_VISITED_TOTAL, |
| 3261 | update_every, |
| 3262 | RRDSET_TYPE_LINE); |
| 3263 | |
| 3264 | rd_tombstoned_objects_visited_total = |
| 3265 | rrddim_add(st_tombstoned_objects_visited_total, "visited", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3266 | } |
| 3267 | |
| 3268 | rrddim_set_by_pointer( |
| 3269 | st_tombstoned_objects_visited_total, |
| 3270 | rd_tombstoned_objects_visited_total, |
| 3271 | (collected_number)tombstonesVisitedPerSec.current.Data); |
| 3272 | rrdset_done(st_tombstoned_objects_visited_total); |
| 3273 | } |
| 3274 | |
| 3275 | static void netdata_ad_cleanup_metrics(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3276 | { |
| 3277 | netdata_ad_cleanup_link_values_cleaned(pDataBlock, pObjectType, update_every); |
| 3278 | netdata_ad_cleanup_phantom_objects_cleaned(pDataBlock, pObjectType, update_every); |
| 3279 | netdata_ad_cleanup_phantom_objects_visited(pDataBlock, pObjectType, update_every); |
| 3280 | netdata_ad_cleanup_tombstoned_objects_collected(pDataBlock, pObjectType, update_every); |
| 3281 | netdata_ad_cleanup_tombstoned_objects_visited(pDataBlock, pObjectType, update_every); |
| 3282 | } |
| 3283 | |
| 3284 | static void |
| 3285 | netdata_ad_sam_group_membership_evaluations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3286 | { |
| 3287 | static COUNTER_DATA samGlobalGroupMembershipEvaluationsPerSec = { |
| 3288 | .key = "SAM Global Group Membership Evaluations/sec"}; |
| 3289 | static COUNTER_DATA samDomainLocalGroupMembershipEvaluationsPerSec = { |
| 3290 | .key = "SAM Domain Local Group Membership Evaluations/sec"}; |
| 3291 | static COUNTER_DATA samUniversalGroupMembershipEvaluationsPerSec = { |
| 3292 | .key = "SAM Universal Group Membership Evaluations/sec"}; |
| 3293 | |
| 3294 | static RRDSET *st_sam_group_membership_evaluations = NULL; |
| 3295 | static RRDDIM *rd_sam_group_membership_evaluations_global = NULL; |
| 3296 | static RRDDIM *rd_sam_group_membership_evaluations_domain_local = NULL; |
| 3297 | static RRDDIM *rd_sam_group_membership_evaluations_universal = NULL; |
| 3298 | |
| 3299 | perflibGetObjectCounter(pDataBlock, pObjectType, &samGlobalGroupMembershipEvaluationsPerSec); |
| 3300 | perflibGetObjectCounter(pDataBlock, pObjectType, &samDomainLocalGroupMembershipEvaluationsPerSec); |
| 3301 | perflibGetObjectCounter(pDataBlock, pObjectType, &samUniversalGroupMembershipEvaluationsPerSec); |
| 3302 | |
| 3303 | if (unlikely(!st_sam_group_membership_evaluations)) { |
| 3304 | st_sam_group_membership_evaluations = rrdset_create_localhost( |
| 3305 | "ad", |
| 3306 | "sam_group_membership_evaluations", |
| 3307 | NULL, |
| 3308 | "sam", |
| 3309 | "ad.sam_group_membership_evaluations", |
| 3310 | "SAM group membership evaluations", |
| 3311 | "evaluations/s", |
| 3312 | PLUGIN_WINDOWS_NAME, |
| 3313 | "PerflibAD", |
| 3314 | PRIO_AD_SAM_GROUP_MEMBERSHIP_EVALUATIONS_TOTAL, |
| 3315 | update_every, |
| 3316 | RRDSET_TYPE_LINE); |
| 3317 | |
| 3318 | rd_sam_group_membership_evaluations_global = |
| 3319 | rrddim_add(st_sam_group_membership_evaluations, "global", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3320 | rd_sam_group_membership_evaluations_domain_local = |
| 3321 | rrddim_add(st_sam_group_membership_evaluations, "domain_local", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3322 | rd_sam_group_membership_evaluations_universal = |
| 3323 | rrddim_add(st_sam_group_membership_evaluations, "universal", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3324 | } |
| 3325 | |
| 3326 | rrddim_set_by_pointer( |
| 3327 | st_sam_group_membership_evaluations, |
| 3328 | rd_sam_group_membership_evaluations_global, |
| 3329 | (collected_number)samGlobalGroupMembershipEvaluationsPerSec.current.Data); |
| 3330 | rrddim_set_by_pointer( |
| 3331 | st_sam_group_membership_evaluations, |
| 3332 | rd_sam_group_membership_evaluations_domain_local, |
| 3333 | (collected_number)samDomainLocalGroupMembershipEvaluationsPerSec.current.Data); |
| 3334 | rrddim_set_by_pointer( |
| 3335 | st_sam_group_membership_evaluations, |
| 3336 | rd_sam_group_membership_evaluations_universal, |
| 3337 | (collected_number)samUniversalGroupMembershipEvaluationsPerSec.current.Data); |
| 3338 | rrdset_done(st_sam_group_membership_evaluations); |
| 3339 | } |
| 3340 | |
| 3341 | static void netdata_ad_sam_group_membership_global_catalog_evaluations( |
| 3342 | PERF_DATA_BLOCK *pDataBlock, |
| 3343 | PERF_OBJECT_TYPE *pObjectType, |
| 3344 | int update_every) |
| 3345 | { |
| 3346 | static COUNTER_DATA samGCEvaluationsPerSec = {.key = "SAM GC Evaluations/sec"}; |
| 3347 | static RRDSET *st_sam_group_membership_global_catalog_evaluations = NULL; |
| 3348 | static RRDDIM *rd_sam_group_membership_global_catalog_evaluations = NULL; |
| 3349 | |
| 3350 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samGCEvaluationsPerSec)) |
| 3351 | return; |
| 3352 | |
| 3353 | if (unlikely(!st_sam_group_membership_global_catalog_evaluations)) { |
| 3354 | st_sam_group_membership_global_catalog_evaluations = rrdset_create_localhost( |
| 3355 | "ad", |
| 3356 | "sam_group_membership_global_catalog_evaluations", |
| 3357 | NULL, |
| 3358 | "sam", |
| 3359 | "ad.sam_group_membership_global_catalog_evaluations", |
| 3360 | "SAM group membership global catalog evaluations", |
| 3361 | "evaluations/s", |
| 3362 | PLUGIN_WINDOWS_NAME, |
| 3363 | "PerflibAD", |
| 3364 | PRIO_AD_SAM_GROUP_MEMBERSHIP_GLOBAL_CATALOG_EVALUATIONS_TOTAL, |
| 3365 | update_every, |
| 3366 | RRDSET_TYPE_LINE); |
| 3367 | |
| 3368 | rd_sam_group_membership_global_catalog_evaluations = rrddim_add( |
| 3369 | st_sam_group_membership_global_catalog_evaluations, "global_catalog", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3370 | } |
| 3371 | |
| 3372 | rrddim_set_by_pointer( |
| 3373 | st_sam_group_membership_global_catalog_evaluations, |
| 3374 | rd_sam_group_membership_global_catalog_evaluations, |
| 3375 | (collected_number)samGCEvaluationsPerSec.current.Data); |
| 3376 | rrdset_done(st_sam_group_membership_global_catalog_evaluations); |
| 3377 | } |
| 3378 | |
| 3379 | static void netdata_ad_sam_group_membership_evaluations_nontransitive( |
| 3380 | PERF_DATA_BLOCK *pDataBlock, |
| 3381 | PERF_OBJECT_TYPE *pObjectType, |
| 3382 | int update_every) |
| 3383 | { |
| 3384 | static COUNTER_DATA samNonTransitiveMembershipEvaluationsPerSec = { |
| 3385 | .key = "SAM Non-Transitive Membership Evaluations/sec"}; |
| 3386 | static RRDSET *st_sam_group_membership_evaluations_nontransitive = NULL; |
| 3387 | static RRDDIM *rd_sam_group_membership_evaluations_nontransitive = NULL; |
| 3388 | |
| 3389 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samNonTransitiveMembershipEvaluationsPerSec)) |
| 3390 | return; |
| 3391 | |
| 3392 | if (unlikely(!st_sam_group_membership_evaluations_nontransitive)) { |
| 3393 | st_sam_group_membership_evaluations_nontransitive = rrdset_create_localhost( |
| 3394 | "ad", |
| 3395 | "sam_group_membership_evaluations_nontransitive", |
| 3396 | NULL, |
| 3397 | "sam", |
| 3398 | "ad.sam_group_membership_evaluations_nontransitive", |
| 3399 | "SAM non-transitive membership evaluations", |
| 3400 | "evaluations/s", |
| 3401 | PLUGIN_WINDOWS_NAME, |
| 3402 | "PerflibAD", |
| 3403 | PRIO_AD_SAM_GROUP_MEMBERSHIP_EVALUATIONS_NONTRANSITIVE_TOTAL, |
| 3404 | update_every, |
| 3405 | RRDSET_TYPE_LINE); |
| 3406 | |
| 3407 | rd_sam_group_membership_evaluations_nontransitive = rrddim_add( |
| 3408 | st_sam_group_membership_evaluations_nontransitive, "nontransitive", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3409 | } |
| 3410 | |
| 3411 | rrddim_set_by_pointer( |
| 3412 | st_sam_group_membership_evaluations_nontransitive, |
| 3413 | rd_sam_group_membership_evaluations_nontransitive, |
| 3414 | (collected_number)samNonTransitiveMembershipEvaluationsPerSec.current.Data); |
| 3415 | rrdset_done(st_sam_group_membership_evaluations_nontransitive); |
| 3416 | } |
| 3417 | |
| 3418 | static void netdata_ad_sam_group_membership_evaluations_transitive( |
| 3419 | PERF_DATA_BLOCK *pDataBlock, |
| 3420 | PERF_OBJECT_TYPE *pObjectType, |
| 3421 | int update_every) |
| 3422 | { |
| 3423 | static COUNTER_DATA samTransitiveMembershipEvaluationsPerSec = {.key = "SAM Transitive Membership Evaluations/sec"}; |
| 3424 | static RRDSET *st_sam_group_membership_evaluations_transitive = NULL; |
| 3425 | static RRDDIM *rd_sam_group_membership_evaluations_transitive = NULL; |
| 3426 | |
| 3427 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samTransitiveMembershipEvaluationsPerSec)) |
| 3428 | return; |
| 3429 | |
| 3430 | if (unlikely(!st_sam_group_membership_evaluations_transitive)) { |
| 3431 | st_sam_group_membership_evaluations_transitive = rrdset_create_localhost( |
| 3432 | "ad", |
| 3433 | "sam_group_membership_evaluations_transitive", |
| 3434 | NULL, |
| 3435 | "sam", |
| 3436 | "ad.sam_group_membership_evaluations_transitive", |
| 3437 | "SAM transitive membership evaluations", |
| 3438 | "evaluations/s", |
| 3439 | PLUGIN_WINDOWS_NAME, |
| 3440 | "PerflibAD", |
| 3441 | PRIO_AD_SAM_GROUP_MEMBERSHIP_EVALUATIONS_TRANSITIVE_TOTAL, |
| 3442 | update_every, |
| 3443 | RRDSET_TYPE_LINE); |
| 3444 | |
| 3445 | rd_sam_group_membership_evaluations_transitive = rrddim_add( |
| 3446 | st_sam_group_membership_evaluations_transitive, "transitive", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3447 | } |
| 3448 | |
| 3449 | rrddim_set_by_pointer( |
| 3450 | st_sam_group_membership_evaluations_transitive, |
| 3451 | rd_sam_group_membership_evaluations_transitive, |
| 3452 | (collected_number)samTransitiveMembershipEvaluationsPerSec.current.Data); |
| 3453 | rrdset_done(st_sam_group_membership_evaluations_transitive); |
| 3454 | } |
| 3455 | |
| 3456 | static void |
| 3457 | netdata_ad_sam_group_evaluation_latency(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3458 | { |
| 3459 | static COUNTER_DATA samAccountGroupEvaluationLatency = {.key = "SAM Account Group Evaluation Latency"}; |
| 3460 | static COUNTER_DATA samResourceGroupEvaluationLatency = {.key = "SAM Resource Group Evaluation Latency"}; |
| 3461 | |
| 3462 | static RRDSET *st_sam_group_evaluation_latency = NULL; |
| 3463 | static RRDDIM *rd_sam_group_evaluation_latency_account_group = NULL; |
| 3464 | static RRDDIM *rd_sam_group_evaluation_latency_resource_group = NULL; |
| 3465 | |
| 3466 | perflibGetObjectCounter(pDataBlock, pObjectType, &samAccountGroupEvaluationLatency); |
| 3467 | perflibGetObjectCounter(pDataBlock, pObjectType, &samResourceGroupEvaluationLatency); |
| 3468 | |
| 3469 | if (unlikely(!st_sam_group_evaluation_latency)) { |
| 3470 | st_sam_group_evaluation_latency = rrdset_create_localhost( |
| 3471 | "ad", |
| 3472 | "sam_group_evaluation_latency", |
| 3473 | NULL, |
| 3474 | "sam", |
| 3475 | "ad.sam_group_evaluation_latency", |
| 3476 | "SAM group evaluation latency", |
| 3477 | "latency", |
| 3478 | PLUGIN_WINDOWS_NAME, |
| 3479 | "PerflibAD", |
| 3480 | PRIO_AD_SAM_GROUP_EVALUATION_LATENCY, |
| 3481 | update_every, |
| 3482 | RRDSET_TYPE_LINE); |
| 3483 | |
| 3484 | rd_sam_group_evaluation_latency_account_group = |
| 3485 | rrddim_add(st_sam_group_evaluation_latency, "account_group", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 3486 | rd_sam_group_evaluation_latency_resource_group = |
| 3487 | rrddim_add(st_sam_group_evaluation_latency, "resource_group", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 3488 | } |
| 3489 | |
| 3490 | rrddim_set_by_pointer( |
| 3491 | st_sam_group_evaluation_latency, |
| 3492 | rd_sam_group_evaluation_latency_account_group, |
| 3493 | (collected_number)samAccountGroupEvaluationLatency.current.Data); |
| 3494 | rrddim_set_by_pointer( |
| 3495 | st_sam_group_evaluation_latency, |
| 3496 | rd_sam_group_evaluation_latency_resource_group, |
| 3497 | (collected_number)samResourceGroupEvaluationLatency.current.Data); |
| 3498 | rrdset_done(st_sam_group_evaluation_latency); |
| 3499 | } |
| 3500 | |
| 3501 | static void |
| 3502 | netdata_ad_sam_computer_creation_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3503 | { |
| 3504 | static COUNTER_DATA samMachineCreationAttemptsPerSec = {.key = "SAM Machine Creation Attempts/sec"}; |
| 3505 | static RRDSET *st_sam_computer_creation_requests = NULL; |
| 3506 | static RRDDIM *rd_sam_computer_creation_requests = NULL; |
| 3507 | |
| 3508 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samMachineCreationAttemptsPerSec)) |
| 3509 | return; |
| 3510 | |
| 3511 | if (unlikely(!st_sam_computer_creation_requests)) { |
| 3512 | st_sam_computer_creation_requests = rrdset_create_localhost( |
| 3513 | "ad", |
| 3514 | "sam_computer_creation_requests", |
| 3515 | NULL, |
| 3516 | "sam", |
| 3517 | "ad.sam_computer_creation_requests", |
| 3518 | "SAM computer creation requests", |
| 3519 | "requests/s", |
| 3520 | PLUGIN_WINDOWS_NAME, |
| 3521 | "PerflibAD", |
| 3522 | PRIO_AD_SAM_COMPUTER_CREATION_REQUESTS_TOTAL, |
| 3523 | update_every, |
| 3524 | RRDSET_TYPE_LINE); |
| 3525 | |
| 3526 | rd_sam_computer_creation_requests = |
| 3527 | rrddim_add(st_sam_computer_creation_requests, "request", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3528 | } |
| 3529 | |
| 3530 | rrddim_set_by_pointer( |
| 3531 | st_sam_computer_creation_requests, |
| 3532 | rd_sam_computer_creation_requests, |
| 3533 | (collected_number)samMachineCreationAttemptsPerSec.current.Data); |
| 3534 | rrdset_done(st_sam_computer_creation_requests); |
| 3535 | } |
| 3536 | |
| 3537 | static void netdata_ad_sam_computer_creation_successful_requests( |
| 3538 | PERF_DATA_BLOCK *pDataBlock, |
| 3539 | PERF_OBJECT_TYPE *pObjectType, |
| 3540 | int update_every) |
| 3541 | { |
| 3542 | static COUNTER_DATA samSuccessfulComputerCreationsPerSecIncludesAllRequests = { |
| 3543 | .key = "SAM Successful Computer Creations/sec: Includes all requests"}; |
| 3544 | static RRDSET *st_sam_computer_creation_successful_requests = NULL; |
| 3545 | static RRDDIM *rd_sam_computer_creation_successful_requests = NULL; |
| 3546 | |
| 3547 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samSuccessfulComputerCreationsPerSecIncludesAllRequests)) |
| 3548 | return; |
| 3549 | |
| 3550 | if (unlikely(!st_sam_computer_creation_successful_requests)) { |
| 3551 | st_sam_computer_creation_successful_requests = rrdset_create_localhost( |
| 3552 | "ad", |
| 3553 | "sam_computer_creation_successful_requests", |
| 3554 | NULL, |
| 3555 | "sam", |
| 3556 | "ad.sam_computer_creation_successful_requests", |
| 3557 | "SAM successful computer creation requests", |
| 3558 | "requests/s", |
| 3559 | PLUGIN_WINDOWS_NAME, |
| 3560 | "PerflibAD", |
| 3561 | PRIO_AD_SAM_COMPUTER_CREATION_SUCCESSFUL_REQUESTS_TOTAL, |
| 3562 | update_every, |
| 3563 | RRDSET_TYPE_LINE); |
| 3564 | |
| 3565 | rd_sam_computer_creation_successful_requests = |
| 3566 | rrddim_add(st_sam_computer_creation_successful_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3567 | } |
| 3568 | |
| 3569 | rrddim_set_by_pointer( |
| 3570 | st_sam_computer_creation_successful_requests, |
| 3571 | rd_sam_computer_creation_successful_requests, |
| 3572 | (collected_number)samSuccessfulComputerCreationsPerSecIncludesAllRequests.current.Data); |
| 3573 | rrdset_done(st_sam_computer_creation_successful_requests); |
| 3574 | } |
| 3575 | |
| 3576 | static void |
| 3577 | netdata_ad_sam_user_creation_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3578 | { |
| 3579 | static COUNTER_DATA samUserCreationAttemptsPerSec = {.key = "SAM User Creation Attempts/sec"}; |
| 3580 | static RRDSET *st_sam_user_creation_requests = NULL; |
| 3581 | static RRDDIM *rd_sam_user_creation_requests = NULL; |
| 3582 | |
| 3583 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samUserCreationAttemptsPerSec)) |
| 3584 | return; |
| 3585 | |
| 3586 | if (unlikely(!st_sam_user_creation_requests)) { |
| 3587 | st_sam_user_creation_requests = rrdset_create_localhost( |
| 3588 | "ad", |
| 3589 | "sam_user_creation_requests", |
| 3590 | NULL, |
| 3591 | "sam", |
| 3592 | "ad.sam_user_creation_requests", |
| 3593 | "SAM user creation requests", |
| 3594 | "requests/s", |
| 3595 | PLUGIN_WINDOWS_NAME, |
| 3596 | "PerflibAD", |
| 3597 | PRIO_AD_SAM_USER_CREATION_REQUESTS_TOTAL, |
| 3598 | update_every, |
| 3599 | RRDSET_TYPE_LINE); |
| 3600 | |
| 3601 | rd_sam_user_creation_requests = |
| 3602 | rrddim_add(st_sam_user_creation_requests, "request", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3603 | } |
| 3604 | |
| 3605 | rrddim_set_by_pointer( |
| 3606 | st_sam_user_creation_requests, |
| 3607 | rd_sam_user_creation_requests, |
| 3608 | (collected_number)samUserCreationAttemptsPerSec.current.Data); |
| 3609 | rrdset_done(st_sam_user_creation_requests); |
| 3610 | } |
| 3611 | |
| 3612 | static void netdata_ad_sam_user_creation_successful_requests( |
| 3613 | PERF_DATA_BLOCK *pDataBlock, |
| 3614 | PERF_OBJECT_TYPE *pObjectType, |
| 3615 | int update_every) |
| 3616 | { |
| 3617 | static COUNTER_DATA samSuccessfulUserCreationsPerSec = {.key = "SAM Successful User Creations/sec"}; |
| 3618 | static RRDSET *st_sam_user_creation_successful_requests = NULL; |
| 3619 | static RRDDIM *rd_sam_user_creation_successful_requests = NULL; |
| 3620 | |
| 3621 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samSuccessfulUserCreationsPerSec)) |
| 3622 | return; |
| 3623 | |
| 3624 | if (unlikely(!st_sam_user_creation_successful_requests)) { |
| 3625 | st_sam_user_creation_successful_requests = rrdset_create_localhost( |
| 3626 | "ad", |
| 3627 | "sam_user_creation_successful_requests", |
| 3628 | NULL, |
| 3629 | "sam", |
| 3630 | "ad.sam_user_creation_successful_requests", |
| 3631 | "SAM successful user creation requests", |
| 3632 | "requests/s", |
| 3633 | PLUGIN_WINDOWS_NAME, |
| 3634 | "PerflibAD", |
| 3635 | PRIO_AD_SAM_USER_CREATION_SUCCESSFUL_REQUESTS_TOTAL, |
| 3636 | update_every, |
| 3637 | RRDSET_TYPE_LINE); |
| 3638 | |
| 3639 | rd_sam_user_creation_successful_requests = |
| 3640 | rrddim_add(st_sam_user_creation_successful_requests, "success", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3641 | } |
| 3642 | |
| 3643 | rrddim_set_by_pointer( |
| 3644 | st_sam_user_creation_successful_requests, |
| 3645 | rd_sam_user_creation_successful_requests, |
| 3646 | (collected_number)samSuccessfulUserCreationsPerSec.current.Data); |
| 3647 | rrdset_done(st_sam_user_creation_successful_requests); |
| 3648 | } |
| 3649 | |
| 3650 | static void |
| 3651 | netdata_ad_sam_query_display_requests(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3652 | { |
| 3653 | static COUNTER_DATA samDisplayInformationQueriesPerSec = {.key = "SAM Display Information Queries/sec"}; |
| 3654 | static RRDSET *st_sam_query_display_requests = NULL; |
| 3655 | static RRDDIM *rd_sam_query_display_requests = NULL; |
| 3656 | |
| 3657 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samDisplayInformationQueriesPerSec)) |
| 3658 | return; |
| 3659 | |
| 3660 | if (unlikely(!st_sam_query_display_requests)) { |
| 3661 | st_sam_query_display_requests = rrdset_create_localhost( |
| 3662 | "ad", |
| 3663 | "sam_query_display_requests", |
| 3664 | NULL, |
| 3665 | "sam", |
| 3666 | "ad.sam_query_display_requests", |
| 3667 | "SAM query display requests", |
| 3668 | "requests/s", |
| 3669 | PLUGIN_WINDOWS_NAME, |
| 3670 | "PerflibAD", |
| 3671 | PRIO_AD_SAM_QUERY_DISPLAY_REQUESTS_TOTAL, |
| 3672 | update_every, |
| 3673 | RRDSET_TYPE_LINE); |
| 3674 | |
| 3675 | rd_sam_query_display_requests = |
| 3676 | rrddim_add(st_sam_query_display_requests, "query", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3677 | } |
| 3678 | |
| 3679 | rrddim_set_by_pointer( |
| 3680 | st_sam_query_display_requests, |
| 3681 | rd_sam_query_display_requests, |
| 3682 | (collected_number)samDisplayInformationQueriesPerSec.current.Data); |
| 3683 | rrdset_done(st_sam_query_display_requests); |
| 3684 | } |
| 3685 | |
| 3686 | static void netdata_ad_sam_enumerations(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3687 | { |
| 3688 | static COUNTER_DATA samEnumerationsPerSec = {.key = "SAM Enumerations/sec"}; |
| 3689 | static RRDSET *st_sam_enumerations = NULL; |
| 3690 | static RRDDIM *rd_sam_enumerations = NULL; |
| 3691 | |
| 3692 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samEnumerationsPerSec)) |
| 3693 | return; |
| 3694 | |
| 3695 | if (unlikely(!st_sam_enumerations)) { |
| 3696 | st_sam_enumerations = rrdset_create_localhost( |
| 3697 | "ad", |
| 3698 | "sam_enumerations", |
| 3699 | NULL, |
| 3700 | "sam", |
| 3701 | "ad.sam_enumerations", |
| 3702 | "SAM enumerations", |
| 3703 | "enumerations/s", |
| 3704 | PLUGIN_WINDOWS_NAME, |
| 3705 | "PerflibAD", |
| 3706 | PRIO_AD_SAM_ENUMERATIONS_TOTAL, |
| 3707 | update_every, |
| 3708 | RRDSET_TYPE_LINE); |
| 3709 | |
| 3710 | rd_sam_enumerations = rrddim_add(st_sam_enumerations, "enumeration", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3711 | } |
| 3712 | |
| 3713 | rrddim_set_by_pointer( |
| 3714 | st_sam_enumerations, rd_sam_enumerations, (collected_number)samEnumerationsPerSec.current.Data); |
| 3715 | rrdset_done(st_sam_enumerations); |
| 3716 | } |
| 3717 | |
| 3718 | static void |
| 3719 | netdata_ad_sam_membership_changes(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3720 | { |
| 3721 | static COUNTER_DATA samMembershipChangesPerSec = {.key = "SAM Membership Changes/sec"}; |
| 3722 | static RRDSET *st_sam_membership_changes = NULL; |
| 3723 | static RRDDIM *rd_sam_membership_changes = NULL; |
| 3724 | |
| 3725 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samMembershipChangesPerSec)) |
| 3726 | return; |
| 3727 | |
| 3728 | if (unlikely(!st_sam_membership_changes)) { |
| 3729 | st_sam_membership_changes = rrdset_create_localhost( |
| 3730 | "ad", |
| 3731 | "sam_membership_changes", |
| 3732 | NULL, |
| 3733 | "sam", |
| 3734 | "ad.sam_membership_changes", |
| 3735 | "SAM membership changes", |
| 3736 | "changes/s", |
| 3737 | PLUGIN_WINDOWS_NAME, |
| 3738 | "PerflibAD", |
| 3739 | PRIO_AD_SAM_MEMBERSHIP_CHANGES_TOTAL, |
| 3740 | update_every, |
| 3741 | RRDSET_TYPE_LINE); |
| 3742 | |
| 3743 | rd_sam_membership_changes = |
| 3744 | rrddim_add(st_sam_membership_changes, "change", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3745 | } |
| 3746 | |
| 3747 | rrddim_set_by_pointer( |
| 3748 | st_sam_membership_changes, |
| 3749 | rd_sam_membership_changes, |
| 3750 | (collected_number)samMembershipChangesPerSec.current.Data); |
| 3751 | rrdset_done(st_sam_membership_changes); |
| 3752 | } |
| 3753 | |
| 3754 | static void |
| 3755 | netdata_ad_sam_password_changes(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3756 | { |
| 3757 | static COUNTER_DATA samPasswordChangesPerSec = {.key = "SAM Password Changes/sec"}; |
| 3758 | static RRDSET *st_sam_password_changes = NULL; |
| 3759 | static RRDDIM *rd_sam_password_changes = NULL; |
| 3760 | |
| 3761 | if (!perflibGetObjectCounter(pDataBlock, pObjectType, &samPasswordChangesPerSec)) |
| 3762 | return; |
| 3763 | |
| 3764 | if (unlikely(!st_sam_password_changes)) { |
| 3765 | st_sam_password_changes = rrdset_create_localhost( |
| 3766 | "ad", |
| 3767 | "sam_password_changes", |
| 3768 | NULL, |
| 3769 | "sam", |
| 3770 | "ad.sam_password_changes", |
| 3771 | "SAM password changes", |
| 3772 | "changes/s", |
| 3773 | PLUGIN_WINDOWS_NAME, |
| 3774 | "PerflibAD", |
| 3775 | PRIO_AD_SAM_PASSWORD_CHANGES_TOTAL, |
| 3776 | update_every, |
| 3777 | RRDSET_TYPE_LINE); |
| 3778 | |
| 3779 | rd_sam_password_changes = rrddim_add(st_sam_password_changes, "change", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 3780 | } |
| 3781 | |
| 3782 | rrddim_set_by_pointer( |
| 3783 | st_sam_password_changes, rd_sam_password_changes, (collected_number)samPasswordChangesPerSec.current.Data); |
| 3784 | rrdset_done(st_sam_password_changes); |
| 3785 | } |
| 3786 | |
| 3787 | static void netdata_ad_sam(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 3788 | { |
| 3789 | netdata_ad_sam_group_membership_evaluations(pDataBlock, pObjectType, update_every); |
| 3790 | netdata_ad_sam_group_membership_global_catalog_evaluations(pDataBlock, pObjectType, update_every); |
| 3791 | netdata_ad_sam_group_membership_evaluations_nontransitive(pDataBlock, pObjectType, update_every); |
| 3792 | netdata_ad_sam_group_membership_evaluations_transitive(pDataBlock, pObjectType, update_every); |
| 3793 | netdata_ad_sam_group_evaluation_latency(pDataBlock, pObjectType, update_every); |
| 3794 | netdata_ad_sam_computer_creation_requests(pDataBlock, pObjectType, update_every); |
| 3795 | netdata_ad_sam_computer_creation_successful_requests(pDataBlock, pObjectType, update_every); |
| 3796 | netdata_ad_sam_user_creation_requests(pDataBlock, pObjectType, update_every); |
| 3797 | netdata_ad_sam_user_creation_successful_requests(pDataBlock, pObjectType, update_every); |
| 3798 | netdata_ad_sam_query_display_requests(pDataBlock, pObjectType, update_every); |
| 3799 | netdata_ad_sam_enumerations(pDataBlock, pObjectType, update_every); |
| 3800 | netdata_ad_sam_membership_changes(pDataBlock, pObjectType, update_every); |
| 3801 | netdata_ad_sam_password_changes(pDataBlock, pObjectType, update_every); |
| 3802 | } |
| 3803 | |
| 3804 | static bool do_AD(PERF_DATA_BLOCK *pDataBlock, int update_every) |
| 3805 | { |
| 3806 | PERF_OBJECT_TYPE *pObjectType = perflibFindObjectTypeByName(pDataBlock, "DirectoryServices"); |
| 3807 | if (!pObjectType) |
| 3808 | return false; |
| 3809 | |
| 3810 | static void (*doAD[])(PERF_DATA_BLOCK *, PERF_OBJECT_TYPE *, int) = { |
| 3811 | netdata_ad_address_book, |
| 3812 | netdata_ad_approximate_highest_dnt, |
| 3813 | netdata_ad_directory, |
| 3814 | netdata_ad_search_scope, |
| 3815 | netdata_ad_cache_lookups, |
| 3816 | netdata_ad_properties, |
| 3817 | netdata_ad_compressed_traffic, |
| 3818 | netdata_ad_replication_highest_usn, |
| 3819 | netdata_ad_replication_inbound, |
| 3820 | netdata_ad_sync, |
| 3821 | netdata_ad_replication_pending_operations, |
| 3822 | netdata_ad_sync_result, |
| 3823 | netdata_ad_cache_hits, |
| 3824 | netdata_ad_name_translations, |
| 3825 | netdata_ad_change_monitors, |
| 3826 | netdata_ad_directory_search_suboperations, |
| 3827 | netdata_ad_security_descriptor_propagation, |
| 3828 | netdata_ad_service_threads_in_use, |
| 3829 | netdata_ad_bind, |
| 3830 | netdata_ad_searches, |
| 3831 | netdata_ad_ldap, |
| 3832 | netdata_ad_cleanup_metrics, |
| 3833 | netdata_ad_sam, |
| 3834 | netdata_ad_atq_queue_requests, |
| 3835 | netdata_ad_atq_estimated_delay, |
| 3836 | netdata_ad_atq_latency, |
| 3837 | netdata_ad_atq_current_threads, |
| 3838 | netdata_ad_op_total, |
| 3839 | netdata_ad_directory_reads, |
| 3840 | netdata_ad_directory_searches, |
| 3841 | netdata_ad_directory_writes, |
| 3842 | netdata_ad_replication_inbound_object_updates_remaining, |
| 3843 | netdata_ad_replication_inbound_values_dns_only, |
| 3844 | netdata_ad_replication_inbound_values_total, |
| 3845 | netdata_ad_replication_outbound_objects_filtered, |
| 3846 | netdata_ad_replication_outbound_objects, |
| 3847 | netdata_ad_replication_outbound_properties, |
| 3848 | netdata_ad_replication_outbound_values_dns_only, |
| 3849 | netdata_ad_replication_outbound_values_total, |
| 3850 | netdata_ad_replication_threads_getting_nc_changes, |
| 3851 | netdata_ad_replication_threads_getting_nc_changes_holding_semaphore, |
| 3852 | netdata_ad_transitive_operations, |
| 3853 | netdata_ad_transitive_suboperations, |
| 3854 | netdata_ad_replication_inbound_bytes_total, |
| 3855 | netdata_ad_replication_outbound_bytes_total, |
| 3856 | |
| 3857 | // This must be the end |
| 3858 | NULL}; |
| 3859 | |
| 3860 | for (int i = 0; doAD[i]; i++) |
| 3861 | doAD[i](pDataBlock, pObjectType, update_every); |
| 3862 | |
| 3863 | return true; |
| 3864 | } |
| 3865 | |
| 3866 | int do_PerflibAD(int update_every, usec_t dt __maybe_unused) |
| 3867 | { |
| 3868 | DWORD id = RegistryFindIDByName("DirectoryServices"); |
| 3869 | if (id == PERFLIB_REGISTRY_NAME_NOT_FOUND) |
| 3870 | return -1; |
| 3871 | |
| 3872 | PERF_DATA_BLOCK *pDataBlock = perflibGetPerformanceData(id); |
| 3873 | if (!pDataBlock) |
| 3874 | return -1; |
| 3875 | |
| 3876 | if (!do_AD(pDataBlock, update_every)) |
| 3877 | return -1; |
| 3878 | |
| 3879 | return 0; |
| 3880 | } |