| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #include "windows_plugin.h" |
| 4 | #include "windows-internals.h" |
| 5 | |
| 6 | struct aspnet_app { |
| 7 | RRDSET *st_aspnet_anonymous_request; |
| 8 | RRDSET *st_aspnet_compilations_total; |
| 9 | RRDSET *st_aspnet_errors_during_preprocessing; |
| 10 | RRDSET *st_aspnet_errors_during_compilation; |
| 11 | RRDSET *st_aspnet_errors_during_execution; |
| 12 | RRDSET *st_aspnet_errors_unhandled_execution_sec; |
| 13 | RRDSET *st_aspnet_requests_byte_total; |
| 14 | RRDSET *st_aspnet_requests_executing; |
| 15 | RRDSET *st_aspnet_requests_failed; |
| 16 | RRDSET *st_aspnet_requests_not_found; |
| 17 | RRDSET *st_aspnet_requests_in_application_queue; |
| 18 | RRDSET *st_aspnet_requests_not_authorized; |
| 19 | RRDSET *st_aspnet_requests_timeout; |
| 20 | RRDSET *st_aspnet_requests_succeeded; |
| 21 | RRDSET *st_aspnet_sessions_active; |
| 22 | RRDSET *st_aspnet_sessions_abandoned; |
| 23 | RRDSET *st_aspnet_sessions_timed_out; |
| 24 | RRDSET *st_aspnet_transactions_aborted; |
| 25 | RRDSET *st_aspnet_transactions_committed; |
| 26 | RRDSET *st_aspnet_transactions_pending; |
| 27 | RRDSET *st_aspnet_transactions_per_sec; |
| 28 | RRDSET *st_aspnet_events_raised_per_sec; |
| 29 | RRDSET *st_aspnet_error_events_raised_per_sec; |
| 30 | RRDSET *st_aspnet_audit_success_events_raised; |
| 31 | RRDSET *st_aspnet_audit_failures_events_raised; |
| 32 | RRDSET *st_aspnet_membership_authentication_success; |
| 33 | RRDSET *st_aspnet_membership_authentication_failure; |
| 34 | RRDSET *st_aspnet_form_authentication_success; |
| 35 | RRDSET *st_aspnet_form_authentication_failure; |
| 36 | |
| 37 | RRDDIM *rd_aspnet_anonymous_request; |
| 38 | RRDDIM *rd_aspnet_compilations_total; |
| 39 | RRDDIM *rd_aspnet_errors_during_preprocessing; |
| 40 | RRDDIM *rd_aspnet_errors_during_compilation; |
| 41 | RRDDIM *rd_aspnet_errors_during_execution; |
| 42 | RRDDIM *rd_aspnet_errors_unhandled_execution_sec; |
| 43 | RRDDIM *rd_aspnet_requests_byte_total_in; |
| 44 | RRDDIM *rd_aspnet_requests_byte_total_out; |
| 45 | RRDDIM *rd_aspnet_requests_executing; |
| 46 | RRDDIM *rd_aspnet_requests_failed; |
| 47 | RRDDIM *rd_aspnet_requests_not_found; |
| 48 | RRDDIM *rd_aspnet_requests_in_application_queue; |
| 49 | RRDDIM *rd_aspnet_requests_not_authorized; |
| 50 | RRDDIM *rd_aspnet_requests_timeout; |
| 51 | RRDDIM *rd_aspnet_requests_succeeded; |
| 52 | RRDDIM *rd_aspnet_sessions_active; |
| 53 | RRDDIM *rd_aspnet_sessions_abandoned; |
| 54 | RRDDIM *rd_aspnet_sessions_timed_out; |
| 55 | RRDDIM *rd_aspnet_transactions_aborted; |
| 56 | RRDDIM *rd_aspnet_transactions_committed; |
| 57 | RRDDIM *rd_aspnet_transactions_pending; |
| 58 | RRDDIM *rd_aspnet_transactions_per_sec; |
| 59 | RRDDIM *rd_aspnet_events_raised_per_sec; |
| 60 | RRDDIM *rd_aspnet_error_events_raised_per_sec; |
| 61 | RRDDIM *rd_aspnet_audit_success_events_raised; |
| 62 | RRDDIM *rd_aspnet_audit_failures_events_raised; |
| 63 | RRDDIM *rd_aspnet_membership_authentication_success; |
| 64 | RRDDIM *rd_aspnet_membership_authentication_failure; |
| 65 | RRDDIM *rd_aspnet_form_authentication_success; |
| 66 | RRDDIM *rd_aspnet_form_authentication_failure; |
| 67 | |
| 68 | COUNTER_DATA aspnetAnonymousRequestPerSec; |
| 69 | COUNTER_DATA aspnetCompilationsTotal; |
| 70 | COUNTER_DATA aspnetErrorsDuringPreProcessing; |
| 71 | COUNTER_DATA aspnetErrorsDuringCompilation; |
| 72 | COUNTER_DATA aspnetErrorsDuringExecution; |
| 73 | COUNTER_DATA aspnetErrorsUnhandledExecutionSec; |
| 74 | COUNTER_DATA aspnetRequestsBytesTotalIn; |
| 75 | COUNTER_DATA aspnetRequestsBytesTotalOut; |
| 76 | COUNTER_DATA aspnetRequestsExecuting; |
| 77 | COUNTER_DATA aspnetRequestsFailed; |
| 78 | COUNTER_DATA aspnetRequestsNotFound; |
| 79 | COUNTER_DATA aspnetRequestsInApplicationQueue; |
| 80 | COUNTER_DATA aspnetRequestsNotAuthorized; |
| 81 | COUNTER_DATA aspnetRequestsTimeout; |
| 82 | COUNTER_DATA aspnetRequestsSucceeded; |
| 83 | COUNTER_DATA aspnetSessionsActive; |
| 84 | COUNTER_DATA aspnetSessionsAbandoned; |
| 85 | COUNTER_DATA aspnetSessionsTimedOut; |
| 86 | COUNTER_DATA aspnetTransactionsAborted; |
| 87 | COUNTER_DATA aspnetTransactionsCommitted; |
| 88 | COUNTER_DATA aspnetTransactionsPending; |
| 89 | COUNTER_DATA aspnetTransactionsPerSec; |
| 90 | COUNTER_DATA aspnetEventsRaisedPerSec; |
| 91 | COUNTER_DATA aspnetErrorEventsRaisedPerSec; |
| 92 | COUNTER_DATA aspnetAuditSuccessEventsRaised; |
| 93 | COUNTER_DATA aspnetAuditFailuresEventsRaised; |
| 94 | COUNTER_DATA aspnetMembershipAuthenticationSuccess; |
| 95 | COUNTER_DATA aspnetMembershipAuthenticationFailure; |
| 96 | COUNTER_DATA aspnetFormAuthenticationSuccess; |
| 97 | COUNTER_DATA aspnetFormAuthenticationFailure; |
| 98 | }; |
| 99 | |
| 100 | DICTIONARY *aspnet_apps; |
| 101 | |
| 102 | static void aspnet_app_initialize_variables(struct aspnet_app *ap) |
| 103 | { |
| 104 | ap->aspnetAnonymousRequestPerSec.key = "Anonymous Requests/Sec"; |
| 105 | ap->aspnetCompilationsTotal.key = "Compilations Total"; |
| 106 | ap->aspnetErrorsDuringPreProcessing.key = "Errors During Preprocessing"; |
| 107 | ap->aspnetErrorsDuringCompilation.key = "Errors During Compilation"; |
| 108 | ap->aspnetErrorsDuringExecution.key = "Errors During Execution"; |
| 109 | ap->aspnetErrorsUnhandledExecutionSec.key = "Errors Unhandled During Execution/Sec"; |
| 110 | ap->aspnetRequestsBytesTotalIn.key = "Request Bytes In Total"; |
| 111 | ap->aspnetRequestsBytesTotalOut.key = "Request Bytes Out Total"; |
| 112 | ap->aspnetRequestsExecuting.key = "Requests Executing"; |
| 113 | ap->aspnetRequestsFailed.key = "Requests Failed"; |
| 114 | ap->aspnetRequestsNotFound.key = "Requests Not Found"; |
| 115 | ap->aspnetRequestsInApplicationQueue.key = "Requests In Application Queue"; |
| 116 | ap->aspnetRequestsNotAuthorized.key = "Requests Not Authorized"; |
| 117 | ap->aspnetRequestsTimeout.key = "Requests Timed Out"; |
| 118 | ap->aspnetRequestsSucceeded.key = "Requests Succeeded"; |
| 119 | ap->aspnetSessionsActive.key = "Sessions Active"; |
| 120 | ap->aspnetSessionsAbandoned.key = "Sessions Abandoned"; |
| 121 | ap->aspnetSessionsTimedOut.key = "Sessions Timed Out"; |
| 122 | ap->aspnetTransactionsAborted.key = "Transactions Aborted"; |
| 123 | ap->aspnetTransactionsCommitted.key = "Transactions Committed"; |
| 124 | ap->aspnetTransactionsPending.key = "Transactions Pending"; |
| 125 | ap->aspnetTransactionsPerSec.key = "Transactions/Sec"; |
| 126 | ap->aspnetEventsRaisedPerSec.key = "Events Raised/Sec"; |
| 127 | ap->aspnetErrorEventsRaisedPerSec.key = "Error Events Raised/Sec"; |
| 128 | ap->aspnetAuditSuccessEventsRaised.key = "Audit Success Events Raised"; |
| 129 | ap->aspnetAuditFailuresEventsRaised.key = "Audit Failure Events Raised"; |
| 130 | ap->aspnetMembershipAuthenticationSuccess.key = "Membership Authentication Success"; |
| 131 | ap->aspnetMembershipAuthenticationFailure.key = "Membership Authentication Failure"; |
| 132 | ap->aspnetFormAuthenticationSuccess.key = "Forms Authentication Success"; |
| 133 | ap->aspnetFormAuthenticationFailure.key = "Forms Authentication Failure"; |
| 134 | }; |
| 135 | |
| 136 | static void |
| 137 | dict_aspnet_insert_app_cb(const DICTIONARY_ITEM *item __maybe_unused, void *value, void *data __maybe_unused) |
| 138 | { |
| 139 | struct aspnet_app *ap = value; |
| 140 | |
| 141 | aspnet_app_initialize_variables(ap); |
| 142 | } |
| 143 | |
| 144 | static void initialize(void) |
| 145 | { |
| 146 | aspnet_apps = dictionary_create_advanced( |
| 147 | DICT_OPTION_DONT_OVERWRITE_VALUE | DICT_OPTION_FIXED_SIZE, NULL, sizeof(struct aspnet_app)); |
| 148 | dictionary_register_insert_callback(aspnet_apps, dict_aspnet_insert_app_cb, NULL); |
| 149 | } |
| 150 | |
| 151 | static void netdata_aspnet_application_restarts(COUNTER_DATA *value, int update_every) |
| 152 | { |
| 153 | static RRDSET *st_aspnet_application_restarts = NULL; |
| 154 | static RRDDIM *rd_aspnet_application_restarts = NULL; |
| 155 | |
| 156 | if (unlikely(!st_aspnet_application_restarts)) { |
| 157 | st_aspnet_application_restarts = rrdset_create_localhost( |
| 158 | "aspnet", |
| 159 | "application_restarts", |
| 160 | NULL, |
| 161 | "aspnet", |
| 162 | "aspnet.application_restarts", |
| 163 | "Number of times the application has been restarted.", |
| 164 | "restarts", |
| 165 | PLUGIN_WINDOWS_NAME, |
| 166 | "PerflibASP", |
| 167 | PRIO_ASPNET_APPLICATION_RESTART, |
| 168 | update_every, |
| 169 | RRDSET_TYPE_LINE); |
| 170 | |
| 171 | rd_aspnet_application_restarts = |
| 172 | rrddim_add(st_aspnet_application_restarts, "restarts", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 173 | } |
| 174 | |
| 175 | rrddim_set_by_pointer( |
| 176 | st_aspnet_application_restarts, rd_aspnet_application_restarts, (collected_number)value->current.Data); |
| 177 | rrdset_done(st_aspnet_application_restarts); |
| 178 | } |
| 179 | |
| 180 | static void netdata_aspnet_worker_process_restarts(COUNTER_DATA *value, int update_every) |
| 181 | { |
| 182 | static RRDSET *st_aspnet_worker_process_restarts = NULL; |
| 183 | static RRDDIM *rd_aspnet_worker_process_restarts = NULL; |
| 184 | |
| 185 | if (unlikely(!st_aspnet_worker_process_restarts)) { |
| 186 | st_aspnet_worker_process_restarts = rrdset_create_localhost( |
| 187 | "aspnet", |
| 188 | "worker_process_restarts", |
| 189 | NULL, |
| 190 | "aspnet", |
| 191 | "aspnet.worker_process_restarts", |
| 192 | "Number of times a worker process has restarted on the machine.", |
| 193 | "restarts", |
| 194 | PLUGIN_WINDOWS_NAME, |
| 195 | "PerflibASP", |
| 196 | PRIO_ASPNET_WORKER_PROCESS_RESTART, |
| 197 | update_every, |
| 198 | RRDSET_TYPE_LINE); |
| 199 | |
| 200 | rd_aspnet_worker_process_restarts = |
| 201 | rrddim_add(st_aspnet_worker_process_restarts, "restarts", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 202 | } |
| 203 | |
| 204 | rrddim_set_by_pointer( |
| 205 | st_aspnet_worker_process_restarts, rd_aspnet_worker_process_restarts, (collected_number)value->current.Data); |
| 206 | rrdset_done(st_aspnet_worker_process_restarts); |
| 207 | } |
| 208 | |
| 209 | static void netdata_aspnet_global_objects(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 210 | { |
| 211 | static COUNTER_DATA appApplicationRestarts = {.key = "Application Restarts"}; |
| 212 | static COUNTER_DATA appWorkerProcessRestarts = {.key = "Worker Process Restarts"}; |
| 213 | |
| 214 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &appApplicationRestarts)) |
| 215 | netdata_aspnet_application_restarts(&appApplicationRestarts, update_every); |
| 216 | |
| 217 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &appWorkerProcessRestarts)) |
| 218 | netdata_aspnet_worker_process_restarts(&appWorkerProcessRestarts, update_every); |
| 219 | } |
| 220 | |
| 221 | static void netdata_aspnet_anonymous_request(struct aspnet_app *aa, char *app, int update_every) |
| 222 | { |
| 223 | if (unlikely(!aa->st_aspnet_anonymous_request)) { |
| 224 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 225 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_anonymous_request", app); |
| 226 | |
| 227 | aa->st_aspnet_anonymous_request = rrdset_create_localhost( |
| 228 | "aspnet", |
| 229 | id, |
| 230 | NULL, |
| 231 | "aspnet", |
| 232 | "aspnet.anonymous_request", |
| 233 | "Number of requests utilizing anonymous authentication.", |
| 234 | "requests", |
| 235 | PLUGIN_WINDOWS_NAME, |
| 236 | "PerflibASP", |
| 237 | PRIO_ASPNET_APP_ANONYMOUS_REQUEST, |
| 238 | update_every, |
| 239 | RRDSET_TYPE_LINE); |
| 240 | |
| 241 | aa->rd_aspnet_anonymous_request = |
| 242 | rrddim_add(aa->st_aspnet_anonymous_request, "request", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 243 | |
| 244 | rrdlabels_add(aa->st_aspnet_anonymous_request->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 245 | } |
| 246 | |
| 247 | rrddim_set_by_pointer( |
| 248 | aa->st_aspnet_anonymous_request, |
| 249 | aa->rd_aspnet_anonymous_request, |
| 250 | (collected_number)aa->aspnetAnonymousRequestPerSec.current.Data); |
| 251 | rrdset_done(aa->st_aspnet_anonymous_request); |
| 252 | } |
| 253 | |
| 254 | static void netdata_aspnet_compilations_total(struct aspnet_app *aa, char *app, int update_every) |
| 255 | { |
| 256 | if (unlikely(!aa->st_aspnet_compilations_total)) { |
| 257 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 258 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_compilation_totals", app); |
| 259 | |
| 260 | aa->st_aspnet_compilations_total = rrdset_create_localhost( |
| 261 | "aspnet", |
| 262 | id, |
| 263 | NULL, |
| 264 | "aspnet", |
| 265 | "aspnet.compilation_totals", |
| 266 | "Number of source files dynamically compiled.", |
| 267 | "compilations", |
| 268 | PLUGIN_WINDOWS_NAME, |
| 269 | "PerflibASP", |
| 270 | PRIO_ASPNET_APP_COMPILATION_TOTALS, |
| 271 | update_every, |
| 272 | RRDSET_TYPE_LINE); |
| 273 | |
| 274 | aa->rd_aspnet_compilations_total = |
| 275 | rrddim_add(aa->st_aspnet_compilations_total, "compilation", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 276 | |
| 277 | rrdlabels_add(aa->st_aspnet_compilations_total->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 278 | } |
| 279 | |
| 280 | rrddim_set_by_pointer( |
| 281 | aa->st_aspnet_compilations_total, |
| 282 | aa->rd_aspnet_compilations_total, |
| 283 | (collected_number)aa->aspnetCompilationsTotal.current.Data); |
| 284 | rrdset_done(aa->st_aspnet_compilations_total); |
| 285 | } |
| 286 | |
| 287 | static void netdata_aspnet_errors_during_preprocessing(struct aspnet_app *aa, char *app, int update_every) |
| 288 | { |
| 289 | if (unlikely(!aa->st_aspnet_errors_during_preprocessing)) { |
| 290 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 291 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_errors_during_preprocessing", app); |
| 292 | |
| 293 | aa->st_aspnet_errors_during_preprocessing = rrdset_create_localhost( |
| 294 | "aspnet", |
| 295 | id, |
| 296 | NULL, |
| 297 | "aspnet", |
| 298 | "aspnet.errors_during_preprocessing", |
| 299 | "Errors During Preprocessing.", |
| 300 | "errors", |
| 301 | PLUGIN_WINDOWS_NAME, |
| 302 | "PerflibASP", |
| 303 | PRIO_ASPNET_ERRORS_DURING_PREPROCESSING, |
| 304 | update_every, |
| 305 | RRDSET_TYPE_LINE); |
| 306 | |
| 307 | aa->rd_aspnet_errors_during_preprocessing = |
| 308 | rrddim_add(aa->st_aspnet_errors_during_preprocessing, "preprocessing", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 309 | |
| 310 | rrdlabels_add(aa->st_aspnet_errors_during_preprocessing->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 311 | } |
| 312 | |
| 313 | rrddim_set_by_pointer( |
| 314 | aa->st_aspnet_errors_during_preprocessing, |
| 315 | aa->rd_aspnet_errors_during_preprocessing, |
| 316 | (collected_number)aa->aspnetErrorsDuringPreProcessing.current.Data); |
| 317 | rrdset_done(aa->st_aspnet_errors_during_preprocessing); |
| 318 | } |
| 319 | |
| 320 | static void netdata_aspnet_errors_during_compilation(struct aspnet_app *aa, char *app, int update_every) |
| 321 | { |
| 322 | if (unlikely(!aa->st_aspnet_errors_during_compilation)) { |
| 323 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 324 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_errors_during_compilation", app); |
| 325 | |
| 326 | aa->st_aspnet_errors_during_compilation = rrdset_create_localhost( |
| 327 | "aspnet", |
| 328 | id, |
| 329 | NULL, |
| 330 | "aspnet", |
| 331 | "aspnet.errors_during_compilation", |
| 332 | "Errors During Compilation.", |
| 333 | "errors", |
| 334 | PLUGIN_WINDOWS_NAME, |
| 335 | "PerflibASP", |
| 336 | PRIO_ASPNET_ERRORS_DURING_COMPILATION, |
| 337 | update_every, |
| 338 | RRDSET_TYPE_LINE); |
| 339 | |
| 340 | aa->rd_aspnet_errors_during_compilation = |
| 341 | rrddim_add(aa->st_aspnet_errors_during_compilation, "compilation", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 342 | |
| 343 | rrdlabels_add(aa->st_aspnet_errors_during_compilation->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 344 | } |
| 345 | |
| 346 | rrddim_set_by_pointer( |
| 347 | aa->st_aspnet_errors_during_compilation, |
| 348 | aa->rd_aspnet_errors_during_compilation, |
| 349 | (collected_number)aa->aspnetErrorsDuringCompilation.current.Data); |
| 350 | rrdset_done(aa->st_aspnet_errors_during_compilation); |
| 351 | } |
| 352 | |
| 353 | static void netdata_aspnet_errors_during_execution(struct aspnet_app *aa, char *app, int update_every) |
| 354 | { |
| 355 | if (unlikely(!aa->st_aspnet_errors_during_execution)) { |
| 356 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 357 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_errors_during_execution", app); |
| 358 | |
| 359 | aa->st_aspnet_errors_during_execution = rrdset_create_localhost( |
| 360 | "aspnet", |
| 361 | id, |
| 362 | NULL, |
| 363 | "aspnet", |
| 364 | "aspnet.errors_during_execution", |
| 365 | "Errors During Execution.", |
| 366 | "errors", |
| 367 | PLUGIN_WINDOWS_NAME, |
| 368 | "PerflibASP", |
| 369 | PRIO_ASPNET_ERRORS_DURING_EXECUTION, |
| 370 | update_every, |
| 371 | RRDSET_TYPE_LINE); |
| 372 | |
| 373 | aa->rd_aspnet_errors_during_execution = |
| 374 | rrddim_add(aa->st_aspnet_errors_during_execution, "execution", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 375 | |
| 376 | rrdlabels_add(aa->st_aspnet_errors_during_execution->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 377 | } |
| 378 | |
| 379 | rrddim_set_by_pointer( |
| 380 | aa->st_aspnet_errors_during_execution, |
| 381 | aa->rd_aspnet_errors_during_execution, |
| 382 | (collected_number)aa->aspnetErrorsDuringExecution.current.Data); |
| 383 | rrdset_done(aa->st_aspnet_errors_during_execution); |
| 384 | } |
| 385 | |
| 386 | static void netdata_aspnet_errors_during_unhandled_execution(struct aspnet_app *aa, char *app, int update_every) |
| 387 | { |
| 388 | if (unlikely(!aa->st_aspnet_errors_unhandled_execution_sec)) { |
| 389 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 390 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_errors_during_unhandled_execution", app); |
| 391 | |
| 392 | aa->st_aspnet_errors_unhandled_execution_sec = rrdset_create_localhost( |
| 393 | "aspnet", |
| 394 | id, |
| 395 | NULL, |
| 396 | "aspnet", |
| 397 | "aspnet.errors_during_unhandled_execution", |
| 398 | "Errors Unhandled During Execution.", |
| 399 | "errors", |
| 400 | PLUGIN_WINDOWS_NAME, |
| 401 | "PerflibASP", |
| 402 | PRIO_ASPNET_ERRORS_UNHANDLED_EXECUTION_PER_SEC, |
| 403 | update_every, |
| 404 | RRDSET_TYPE_LINE); |
| 405 | |
| 406 | aa->rd_aspnet_errors_unhandled_execution_sec = |
| 407 | rrddim_add(aa->st_aspnet_errors_unhandled_execution_sec, "unhandled", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 408 | |
| 409 | rrdlabels_add(aa->st_aspnet_errors_unhandled_execution_sec->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 410 | } |
| 411 | |
| 412 | rrddim_set_by_pointer( |
| 413 | aa->st_aspnet_errors_unhandled_execution_sec, |
| 414 | aa->rd_aspnet_errors_unhandled_execution_sec, |
| 415 | (collected_number)aa->aspnetErrorsUnhandledExecutionSec.current.Data); |
| 416 | rrdset_done(aa->st_aspnet_errors_unhandled_execution_sec); |
| 417 | } |
| 418 | |
| 419 | static inline void netdata_aspnet_apps_runtime_errors( |
| 420 | PERF_DATA_BLOCK *pDataBlock, |
| 421 | PERF_OBJECT_TYPE *pObjectType, |
| 422 | struct aspnet_app *aa, |
| 423 | int update_every) |
| 424 | { |
| 425 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetErrorsDuringPreProcessing)) |
| 426 | netdata_aspnet_errors_during_preprocessing(aa, windows_shared_buffer, update_every); |
| 427 | |
| 428 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetErrorsDuringCompilation)) |
| 429 | netdata_aspnet_errors_during_compilation(aa, windows_shared_buffer, update_every); |
| 430 | |
| 431 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetErrorsDuringExecution)) |
| 432 | netdata_aspnet_errors_during_execution(aa, windows_shared_buffer, update_every); |
| 433 | |
| 434 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetErrorsUnhandledExecutionSec)) |
| 435 | netdata_aspnet_errors_during_unhandled_execution(aa, windows_shared_buffer, update_every); |
| 436 | } |
| 437 | |
| 438 | static void netdata_aspnet_requests_bytes(struct aspnet_app *aa, char *app, int update_every) |
| 439 | { |
| 440 | if (unlikely(!aa->st_aspnet_requests_byte_total)) { |
| 441 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 442 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_byte_total", app); |
| 443 | |
| 444 | aa->st_aspnet_requests_byte_total = rrdset_create_localhost( |
| 445 | "aspnet", |
| 446 | id, |
| 447 | NULL, |
| 448 | "aspnet", |
| 449 | "aspnet.requests_byte_total", |
| 450 | "Size of responses and request.", |
| 451 | "bytes", |
| 452 | PLUGIN_WINDOWS_NAME, |
| 453 | "PerflibASP", |
| 454 | PRIO_ASPNET_REQUESTS_BYTES_TOTAL, |
| 455 | update_every, |
| 456 | RRDSET_TYPE_LINE); |
| 457 | |
| 458 | aa->rd_aspnet_requests_byte_total_in = |
| 459 | rrddim_add(aa->st_aspnet_requests_byte_total, "in", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 460 | |
| 461 | aa->rd_aspnet_requests_byte_total_out = |
| 462 | rrddim_add(aa->st_aspnet_requests_byte_total, "out", NULL, -1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 463 | |
| 464 | rrdlabels_add(aa->st_aspnet_requests_byte_total->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 465 | } |
| 466 | |
| 467 | rrddim_set_by_pointer( |
| 468 | aa->st_aspnet_requests_byte_total, |
| 469 | aa->rd_aspnet_requests_byte_total_in, |
| 470 | (collected_number)aa->aspnetRequestsBytesTotalIn.current.Data); |
| 471 | |
| 472 | rrddim_set_by_pointer( |
| 473 | aa->st_aspnet_requests_byte_total, |
| 474 | aa->rd_aspnet_requests_byte_total_out, |
| 475 | (collected_number)aa->aspnetRequestsBytesTotalOut.current.Data); |
| 476 | rrdset_done(aa->st_aspnet_requests_byte_total); |
| 477 | } |
| 478 | |
| 479 | static void netdata_aspnet_requests_executing(struct aspnet_app *aa, char *app, int update_every) |
| 480 | { |
| 481 | if (unlikely(!aa->st_aspnet_requests_executing)) { |
| 482 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 483 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_executing", app); |
| 484 | |
| 485 | aa->st_aspnet_requests_executing = rrdset_create_localhost( |
| 486 | "aspnet", |
| 487 | id, |
| 488 | NULL, |
| 489 | "aspnet", |
| 490 | "aspnet.requests_executing", |
| 491 | "The number of requests currently executing.", |
| 492 | "requests", |
| 493 | PLUGIN_WINDOWS_NAME, |
| 494 | "PerflibASP", |
| 495 | PRIO_ASPNET_REQUESTS_EXECUTING, |
| 496 | update_every, |
| 497 | RRDSET_TYPE_LINE); |
| 498 | |
| 499 | aa->rd_aspnet_requests_executing = |
| 500 | rrddim_add(aa->st_aspnet_requests_executing, "executing", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 501 | |
| 502 | rrdlabels_add(aa->st_aspnet_requests_executing->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 503 | } |
| 504 | |
| 505 | rrddim_set_by_pointer( |
| 506 | aa->st_aspnet_requests_executing, |
| 507 | aa->rd_aspnet_requests_executing, |
| 508 | (collected_number)aa->aspnetRequestsExecuting.current.Data); |
| 509 | rrdset_done(aa->st_aspnet_requests_executing); |
| 510 | } |
| 511 | |
| 512 | static void netdata_aspnet_requests_failed(struct aspnet_app *aa, char *app, int update_every) |
| 513 | { |
| 514 | if (unlikely(!aa->st_aspnet_requests_failed)) { |
| 515 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 516 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_failed", app); |
| 517 | |
| 518 | aa->st_aspnet_requests_failed = rrdset_create_localhost( |
| 519 | "aspnet", |
| 520 | id, |
| 521 | NULL, |
| 522 | "aspnet", |
| 523 | "aspnet.requests_failed", |
| 524 | "Number of failed requests.", |
| 525 | "requests", |
| 526 | PLUGIN_WINDOWS_NAME, |
| 527 | "PerflibASP", |
| 528 | PRIO_ASPNET_REQUESTS_FAILED, |
| 529 | update_every, |
| 530 | RRDSET_TYPE_LINE); |
| 531 | |
| 532 | aa->rd_aspnet_requests_failed = |
| 533 | rrddim_add(aa->st_aspnet_requests_failed, "failed", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 534 | |
| 535 | rrdlabels_add(aa->st_aspnet_requests_failed->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 536 | } |
| 537 | |
| 538 | rrddim_set_by_pointer( |
| 539 | aa->st_aspnet_requests_failed, |
| 540 | aa->rd_aspnet_requests_failed, |
| 541 | (collected_number)aa->aspnetRequestsFailed.current.Data); |
| 542 | rrdset_done(aa->st_aspnet_requests_failed); |
| 543 | } |
| 544 | |
| 545 | static void netdata_aspnet_requests_not_found(struct aspnet_app *aa, char *app, int update_every) |
| 546 | { |
| 547 | if (unlikely(!aa->st_aspnet_requests_not_found)) { |
| 548 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 549 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_not_found", app); |
| 550 | |
| 551 | aa->st_aspnet_requests_not_found = rrdset_create_localhost( |
| 552 | "aspnet", |
| 553 | id, |
| 554 | NULL, |
| 555 | "aspnet", |
| 556 | "aspnet.requests_not_found", |
| 557 | "Requests for resources that were not found.", |
| 558 | "requests", |
| 559 | PLUGIN_WINDOWS_NAME, |
| 560 | "PerflibASP", |
| 561 | PRIO_ASPNET_REQUESTS_NOT_FOUND, |
| 562 | update_every, |
| 563 | RRDSET_TYPE_LINE); |
| 564 | |
| 565 | aa->rd_aspnet_requests_not_found = |
| 566 | rrddim_add(aa->st_aspnet_requests_not_found, "not found", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 567 | |
| 568 | rrdlabels_add(aa->st_aspnet_requests_not_found->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 569 | } |
| 570 | |
| 571 | rrddim_set_by_pointer( |
| 572 | aa->st_aspnet_requests_not_found, |
| 573 | aa->rd_aspnet_requests_not_found, |
| 574 | (collected_number)aa->aspnetRequestsNotFound.current.Data); |
| 575 | rrdset_done(aa->st_aspnet_requests_not_found); |
| 576 | } |
| 577 | |
| 578 | static void netdata_aspnet_requests_in_application_queue(struct aspnet_app *aa, char *app, int update_every) |
| 579 | { |
| 580 | if (unlikely(!aa->st_aspnet_requests_in_application_queue)) { |
| 581 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 582 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_in_application_queue", app); |
| 583 | |
| 584 | aa->st_aspnet_requests_in_application_queue = rrdset_create_localhost( |
| 585 | "aspnet", |
| 586 | id, |
| 587 | NULL, |
| 588 | "aspnet", |
| 589 | "aspnet.requests_in_application_queue", |
| 590 | "Requests in the application queue.", |
| 591 | "requests", |
| 592 | PLUGIN_WINDOWS_NAME, |
| 593 | "PerflibASP", |
| 594 | PRIO_ASPNET_REQUESTS_IN_APPLICATION_QUEUE, |
| 595 | update_every, |
| 596 | RRDSET_TYPE_LINE); |
| 597 | |
| 598 | aa->rd_aspnet_requests_in_application_queue = |
| 599 | rrddim_add(aa->st_aspnet_requests_in_application_queue, "queue", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 600 | |
| 601 | rrdlabels_add(aa->st_aspnet_requests_in_application_queue->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 602 | } |
| 603 | |
| 604 | rrddim_set_by_pointer( |
| 605 | aa->st_aspnet_requests_in_application_queue, |
| 606 | aa->rd_aspnet_requests_in_application_queue, |
| 607 | (collected_number)aa->aspnetRequestsInApplicationQueue.current.Data); |
| 608 | rrdset_done(aa->st_aspnet_requests_in_application_queue); |
| 609 | } |
| 610 | |
| 611 | static void netdata_aspnet_requests_not_authorized(struct aspnet_app *aa, char *app, int update_every) |
| 612 | { |
| 613 | if (unlikely(!aa->st_aspnet_requests_not_authorized)) { |
| 614 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 615 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_not_authorized", app); |
| 616 | |
| 617 | aa->st_aspnet_requests_not_authorized = rrdset_create_localhost( |
| 618 | "aspnet", |
| 619 | id, |
| 620 | NULL, |
| 621 | "aspnet", |
| 622 | "aspnet.requests_not_authorized", |
| 623 | "Requests that were not authorized.", |
| 624 | "requests", |
| 625 | PLUGIN_WINDOWS_NAME, |
| 626 | "PerflibASP", |
| 627 | PRIO_ASPNET_REQUESTS_NOT_AUTHORIZED, |
| 628 | update_every, |
| 629 | RRDSET_TYPE_LINE); |
| 630 | |
| 631 | aa->rd_aspnet_requests_not_authorized = |
| 632 | rrddim_add(aa->st_aspnet_requests_not_authorized, "not_authorized", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 633 | |
| 634 | rrdlabels_add(aa->st_aspnet_requests_not_authorized->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 635 | } |
| 636 | |
| 637 | rrddim_set_by_pointer( |
| 638 | aa->st_aspnet_requests_not_authorized, |
| 639 | aa->rd_aspnet_requests_not_authorized, |
| 640 | (collected_number)aa->aspnetRequestsNotAuthorized.current.Data); |
| 641 | rrdset_done(aa->st_aspnet_requests_not_authorized); |
| 642 | } |
| 643 | |
| 644 | static void netdata_aspnet_requests_timeout(struct aspnet_app *aa, char *app, int update_every) |
| 645 | { |
| 646 | if (unlikely(!aa->st_aspnet_requests_timeout)) { |
| 647 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 648 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_timeout", app); |
| 649 | |
| 650 | aa->st_aspnet_requests_timeout = rrdset_create_localhost( |
| 651 | "aspnet", |
| 652 | id, |
| 653 | NULL, |
| 654 | "aspnet", |
| 655 | "aspnet.requests_timeout", |
| 656 | "Requests that timed out.", |
| 657 | "requests", |
| 658 | PLUGIN_WINDOWS_NAME, |
| 659 | "PerflibASP", |
| 660 | PRIO_ASPNET_REQUESTS_TIMEOUT, |
| 661 | update_every, |
| 662 | RRDSET_TYPE_LINE); |
| 663 | |
| 664 | aa->rd_aspnet_requests_timeout = |
| 665 | rrddim_add(aa->st_aspnet_requests_timeout, "timeout", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 666 | |
| 667 | rrdlabels_add(aa->st_aspnet_requests_timeout->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 668 | } |
| 669 | |
| 670 | rrddim_set_by_pointer( |
| 671 | aa->st_aspnet_requests_timeout, |
| 672 | aa->rd_aspnet_requests_timeout, |
| 673 | (collected_number)aa->aspnetRequestsTimeout.current.Data); |
| 674 | rrdset_done(aa->st_aspnet_requests_timeout); |
| 675 | } |
| 676 | |
| 677 | static void netdata_aspnet_requests_succeeded(struct aspnet_app *aa, char *app, int update_every) |
| 678 | { |
| 679 | if (unlikely(!aa->st_aspnet_requests_succeeded)) { |
| 680 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 681 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_requests_succeeded", app); |
| 682 | |
| 683 | aa->st_aspnet_requests_succeeded = rrdset_create_localhost( |
| 684 | "aspnet", |
| 685 | id, |
| 686 | NULL, |
| 687 | "aspnet", |
| 688 | "aspnet.requests_succeeded", |
| 689 | "Requests that executed successfully.", |
| 690 | "requests", |
| 691 | PLUGIN_WINDOWS_NAME, |
| 692 | "PerflibASP", |
| 693 | PRIO_ASPNET_REQUESTS_SUCCEEDED, |
| 694 | update_every, |
| 695 | RRDSET_TYPE_LINE); |
| 696 | |
| 697 | aa->rd_aspnet_requests_succeeded = |
| 698 | rrddim_add(aa->st_aspnet_requests_succeeded, "success", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 699 | |
| 700 | rrdlabels_add(aa->st_aspnet_requests_succeeded->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 701 | } |
| 702 | |
| 703 | rrddim_set_by_pointer( |
| 704 | aa->st_aspnet_requests_succeeded, |
| 705 | aa->rd_aspnet_requests_succeeded, |
| 706 | (collected_number)aa->aspnetRequestsSucceeded.current.Data); |
| 707 | rrdset_done(aa->st_aspnet_requests_succeeded); |
| 708 | } |
| 709 | |
| 710 | static inline void netdata_aspnet_apps_requests( |
| 711 | PERF_DATA_BLOCK *pDataBlock, |
| 712 | PERF_OBJECT_TYPE *pObjectType, |
| 713 | struct aspnet_app *aa, |
| 714 | int update_every) |
| 715 | { |
| 716 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsBytesTotalIn) && |
| 717 | perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsBytesTotalOut)) |
| 718 | netdata_aspnet_requests_bytes(aa, windows_shared_buffer, update_every); |
| 719 | |
| 720 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsExecuting)) |
| 721 | netdata_aspnet_requests_executing(aa, windows_shared_buffer, update_every); |
| 722 | |
| 723 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsFailed)) |
| 724 | netdata_aspnet_requests_failed(aa, windows_shared_buffer, update_every); |
| 725 | |
| 726 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsNotFound)) |
| 727 | netdata_aspnet_requests_not_found(aa, windows_shared_buffer, update_every); |
| 728 | |
| 729 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsInApplicationQueue)) |
| 730 | netdata_aspnet_requests_in_application_queue(aa, windows_shared_buffer, update_every); |
| 731 | |
| 732 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsNotAuthorized)) |
| 733 | netdata_aspnet_requests_not_authorized(aa, windows_shared_buffer, update_every); |
| 734 | |
| 735 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsTimeout)) |
| 736 | netdata_aspnet_requests_timeout(aa, windows_shared_buffer, update_every); |
| 737 | |
| 738 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetRequestsSucceeded)) |
| 739 | netdata_aspnet_requests_succeeded(aa, windows_shared_buffer, update_every); |
| 740 | } |
| 741 | |
| 742 | static void netdata_aspnet_sessions_active(struct aspnet_app *aa, char *app, int update_every) |
| 743 | { |
| 744 | if (unlikely(!aa->st_aspnet_sessions_active)) { |
| 745 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 746 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_sessions_active", app); |
| 747 | |
| 748 | aa->st_aspnet_sessions_active = rrdset_create_localhost( |
| 749 | "aspnet", |
| 750 | id, |
| 751 | NULL, |
| 752 | "aspnet", |
| 753 | "aspnet.sessions_active", |
| 754 | "Sessions currently active.", |
| 755 | "sessions", |
| 756 | PLUGIN_WINDOWS_NAME, |
| 757 | "PerflibASP", |
| 758 | PRIO_ASPNET_SESSIONS_ACTIVE, |
| 759 | update_every, |
| 760 | RRDSET_TYPE_LINE); |
| 761 | |
| 762 | aa->rd_aspnet_sessions_active = |
| 763 | rrddim_add(aa->st_aspnet_sessions_active, "active", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 764 | |
| 765 | rrdlabels_add(aa->st_aspnet_sessions_active->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 766 | } |
| 767 | |
| 768 | rrddim_set_by_pointer( |
| 769 | aa->st_aspnet_sessions_active, |
| 770 | aa->rd_aspnet_sessions_active, |
| 771 | (collected_number)aa->aspnetSessionsActive.current.Data); |
| 772 | rrdset_done(aa->st_aspnet_sessions_active); |
| 773 | } |
| 774 | |
| 775 | static void netdata_aspnet_sessions_abandoned(struct aspnet_app *aa, char *app, int update_every) |
| 776 | { |
| 777 | if (unlikely(!aa->st_aspnet_sessions_abandoned)) { |
| 778 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 779 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_sessions_abandoned", app); |
| 780 | |
| 781 | aa->st_aspnet_sessions_abandoned = rrdset_create_localhost( |
| 782 | "aspnet", |
| 783 | id, |
| 784 | NULL, |
| 785 | "aspnet", |
| 786 | "aspnet.sessions_abandoned", |
| 787 | "Sessions explicitly abandoned.", |
| 788 | "sessions", |
| 789 | PLUGIN_WINDOWS_NAME, |
| 790 | "PerflibASP", |
| 791 | PRIO_ASPNET_SESSIONS_ABANDONED, |
| 792 | update_every, |
| 793 | RRDSET_TYPE_LINE); |
| 794 | |
| 795 | aa->rd_aspnet_sessions_abandoned = |
| 796 | rrddim_add(aa->st_aspnet_sessions_abandoned, "abandoned", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 797 | |
| 798 | rrdlabels_add(aa->st_aspnet_sessions_abandoned->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 799 | } |
| 800 | |
| 801 | rrddim_set_by_pointer( |
| 802 | aa->st_aspnet_sessions_abandoned, |
| 803 | aa->rd_aspnet_sessions_abandoned, |
| 804 | (collected_number)aa->aspnetSessionsAbandoned.current.Data); |
| 805 | rrdset_done(aa->st_aspnet_sessions_abandoned); |
| 806 | } |
| 807 | |
| 808 | static void netdata_aspnet_sessions_timedout(struct aspnet_app *aa, char *app, int update_every) |
| 809 | { |
| 810 | if (unlikely(!aa->st_aspnet_sessions_timed_out)) { |
| 811 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 812 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_sessions_timed_out", app); |
| 813 | |
| 814 | aa->st_aspnet_sessions_timed_out = rrdset_create_localhost( |
| 815 | "aspnet", |
| 816 | id, |
| 817 | NULL, |
| 818 | "aspnet", |
| 819 | "aspnet.sessions_timed_out", |
| 820 | "Sessions timed out.", |
| 821 | "sessions", |
| 822 | PLUGIN_WINDOWS_NAME, |
| 823 | "PerflibASP", |
| 824 | PRIO_ASPNET_SESSIONS_TIMEDOUT, |
| 825 | update_every, |
| 826 | RRDSET_TYPE_LINE); |
| 827 | |
| 828 | aa->rd_aspnet_sessions_timed_out = |
| 829 | rrddim_add(aa->st_aspnet_sessions_timed_out, "timed out", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 830 | |
| 831 | rrdlabels_add(aa->st_aspnet_sessions_timed_out->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 832 | } |
| 833 | |
| 834 | rrddim_set_by_pointer( |
| 835 | aa->st_aspnet_sessions_timed_out, |
| 836 | aa->rd_aspnet_sessions_timed_out, |
| 837 | (collected_number)aa->aspnetSessionsTimedOut.current.Data); |
| 838 | rrdset_done(aa->st_aspnet_sessions_timed_out); |
| 839 | } |
| 840 | |
| 841 | static inline void netdata_aspnet_apps_sessions( |
| 842 | PERF_DATA_BLOCK *pDataBlock, |
| 843 | PERF_OBJECT_TYPE *pObjectType, |
| 844 | struct aspnet_app *aa, |
| 845 | int update_every) |
| 846 | { |
| 847 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetSessionsActive)) |
| 848 | netdata_aspnet_sessions_active(aa, windows_shared_buffer, update_every); |
| 849 | |
| 850 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetSessionsAbandoned)) |
| 851 | netdata_aspnet_sessions_abandoned(aa, windows_shared_buffer, update_every); |
| 852 | |
| 853 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetSessionsTimedOut)) |
| 854 | netdata_aspnet_sessions_timedout(aa, windows_shared_buffer, update_every); |
| 855 | } |
| 856 | |
| 857 | static void netdata_aspnet_transactions_aborted(struct aspnet_app *aa, char *app, int update_every) |
| 858 | { |
| 859 | if (unlikely(!aa->st_aspnet_transactions_aborted)) { |
| 860 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 861 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_transactions_aborted", app); |
| 862 | |
| 863 | aa->st_aspnet_transactions_aborted = rrdset_create_localhost( |
| 864 | "aspnet", |
| 865 | id, |
| 866 | NULL, |
| 867 | "aspnet", |
| 868 | "aspnet.transactions_aborted", |
| 869 | "Transactions Aborted", |
| 870 | "transactions", |
| 871 | PLUGIN_WINDOWS_NAME, |
| 872 | "PerflibASP", |
| 873 | PRIO_ASPNET_TRANSACTIONS_ABORTED, |
| 874 | update_every, |
| 875 | RRDSET_TYPE_LINE); |
| 876 | |
| 877 | aa->rd_aspnet_transactions_aborted = |
| 878 | rrddim_add(aa->st_aspnet_transactions_aborted, "aborted", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 879 | |
| 880 | rrdlabels_add(aa->st_aspnet_transactions_aborted->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 881 | } |
| 882 | |
| 883 | rrddim_set_by_pointer( |
| 884 | aa->st_aspnet_transactions_aborted, |
| 885 | aa->rd_aspnet_transactions_aborted, |
| 886 | (collected_number)aa->aspnetTransactionsAborted.current.Data); |
| 887 | rrdset_done(aa->st_aspnet_transactions_aborted); |
| 888 | } |
| 889 | |
| 890 | static void netdata_aspnet_transactions_committed(struct aspnet_app *aa, char *app, int update_every) |
| 891 | { |
| 892 | if (unlikely(!aa->st_aspnet_transactions_committed)) { |
| 893 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 894 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_transactions_committed", app); |
| 895 | |
| 896 | aa->st_aspnet_transactions_committed = rrdset_create_localhost( |
| 897 | "aspnet", |
| 898 | id, |
| 899 | NULL, |
| 900 | "aspnet", |
| 901 | "aspnet.transactions_committed", |
| 902 | "Transactions Committed.", |
| 903 | "transactions", |
| 904 | PLUGIN_WINDOWS_NAME, |
| 905 | "PerflibASP", |
| 906 | PRIO_ASPNET_TRANSACTIONS_COMMITTED, |
| 907 | update_every, |
| 908 | RRDSET_TYPE_LINE); |
| 909 | |
| 910 | aa->rd_aspnet_transactions_committed = |
| 911 | rrddim_add(aa->st_aspnet_transactions_committed, "committed", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 912 | |
| 913 | rrdlabels_add(aa->st_aspnet_transactions_committed->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 914 | } |
| 915 | |
| 916 | rrddim_set_by_pointer( |
| 917 | aa->st_aspnet_transactions_committed, |
| 918 | aa->rd_aspnet_transactions_committed, |
| 919 | (collected_number)aa->aspnetTransactionsCommitted.current.Data); |
| 920 | rrdset_done(aa->st_aspnet_transactions_committed); |
| 921 | } |
| 922 | |
| 923 | static void netdata_aspnet_transactions_pending(struct aspnet_app *aa, char *app, int update_every) |
| 924 | { |
| 925 | if (unlikely(!aa->st_aspnet_transactions_pending)) { |
| 926 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 927 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_transactions_pending", app); |
| 928 | |
| 929 | aa->st_aspnet_transactions_pending = rrdset_create_localhost( |
| 930 | "aspnet", |
| 931 | id, |
| 932 | NULL, |
| 933 | "aspnet", |
| 934 | "aspnet.transactions_pending", |
| 935 | "Transactions Pending.", |
| 936 | "transactions", |
| 937 | PLUGIN_WINDOWS_NAME, |
| 938 | "PerflibASP", |
| 939 | PRIO_ASPNET_TRANSACTIONS_PENDING, |
| 940 | update_every, |
| 941 | RRDSET_TYPE_LINE); |
| 942 | |
| 943 | aa->rd_aspnet_transactions_pending = |
| 944 | rrddim_add(aa->st_aspnet_transactions_pending, "pending", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 945 | |
| 946 | rrdlabels_add(aa->st_aspnet_transactions_pending->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 947 | } |
| 948 | |
| 949 | rrddim_set_by_pointer( |
| 950 | aa->st_aspnet_transactions_pending, |
| 951 | aa->rd_aspnet_transactions_pending, |
| 952 | (collected_number)aa->aspnetTransactionsPending.current.Data); |
| 953 | rrdset_done(aa->st_aspnet_transactions_pending); |
| 954 | } |
| 955 | |
| 956 | static void netdata_aspnet_transactions_per_sec(struct aspnet_app *aa, char *app, int update_every) |
| 957 | { |
| 958 | if (unlikely(!aa->st_aspnet_transactions_per_sec)) { |
| 959 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 960 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_transactions_per_sec", app); |
| 961 | |
| 962 | aa->st_aspnet_transactions_per_sec = rrdset_create_localhost( |
| 963 | "aspnet", |
| 964 | id, |
| 965 | NULL, |
| 966 | "aspnet", |
| 967 | "aspnet.transactions_per_sec", |
| 968 | "Transactions Started.", |
| 969 | "transactions", |
| 970 | PLUGIN_WINDOWS_NAME, |
| 971 | "PerflibASP", |
| 972 | PRIO_ASPNET_TRANSACTIONS_PER_SEC, |
| 973 | update_every, |
| 974 | RRDSET_TYPE_LINE); |
| 975 | |
| 976 | aa->rd_aspnet_transactions_per_sec = |
| 977 | rrddim_add(aa->st_aspnet_transactions_per_sec, "transactions", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 978 | |
| 979 | rrdlabels_add(aa->st_aspnet_transactions_per_sec->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 980 | } |
| 981 | |
| 982 | rrddim_set_by_pointer( |
| 983 | aa->st_aspnet_transactions_per_sec, |
| 984 | aa->rd_aspnet_transactions_per_sec, |
| 985 | (collected_number)aa->aspnetTransactionsPerSec.current.Data); |
| 986 | rrdset_done(aa->st_aspnet_transactions_per_sec); |
| 987 | } |
| 988 | |
| 989 | static inline void netdata_aspnet_apps_transactions( |
| 990 | PERF_DATA_BLOCK *pDataBlock, |
| 991 | PERF_OBJECT_TYPE *pObjectType, |
| 992 | struct aspnet_app *aa, |
| 993 | int update_every) |
| 994 | { |
| 995 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetTransactionsAborted)) |
| 996 | netdata_aspnet_transactions_aborted(aa, windows_shared_buffer, update_every); |
| 997 | |
| 998 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetTransactionsCommitted)) |
| 999 | netdata_aspnet_transactions_committed(aa, windows_shared_buffer, update_every); |
| 1000 | |
| 1001 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetTransactionsPending)) |
| 1002 | netdata_aspnet_transactions_pending(aa, windows_shared_buffer, update_every); |
| 1003 | |
| 1004 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetTransactionsPerSec)) |
| 1005 | netdata_aspnet_transactions_per_sec(aa, windows_shared_buffer, update_every); |
| 1006 | } |
| 1007 | |
| 1008 | static void netdata_aspnet_events_raised(struct aspnet_app *aa, char *app, int update_every) |
| 1009 | { |
| 1010 | if (unlikely(!aa->st_aspnet_events_raised_per_sec)) { |
| 1011 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1012 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_events_raised_per_sec", app); |
| 1013 | |
| 1014 | aa->st_aspnet_events_raised_per_sec = rrdset_create_localhost( |
| 1015 | "aspnet", |
| 1016 | id, |
| 1017 | NULL, |
| 1018 | "aspnet", |
| 1019 | "aspnet.events_raised_per_sec", |
| 1020 | "Instrumentation events.", |
| 1021 | "events", |
| 1022 | PLUGIN_WINDOWS_NAME, |
| 1023 | "PerflibASP", |
| 1024 | PRIO_ASPNET_EVENTS_RAISED_PER_SEC, |
| 1025 | update_every, |
| 1026 | RRDSET_TYPE_LINE); |
| 1027 | |
| 1028 | aa->rd_aspnet_events_raised_per_sec = |
| 1029 | rrddim_add(aa->st_aspnet_events_raised_per_sec, "raised", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1030 | |
| 1031 | rrdlabels_add(aa->st_aspnet_events_raised_per_sec->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1032 | } |
| 1033 | |
| 1034 | rrddim_set_by_pointer( |
| 1035 | aa->st_aspnet_events_raised_per_sec, |
| 1036 | aa->rd_aspnet_events_raised_per_sec, |
| 1037 | (collected_number)aa->aspnetEventsRaisedPerSec.current.Data); |
| 1038 | rrdset_done(aa->st_aspnet_events_raised_per_sec); |
| 1039 | } |
| 1040 | |
| 1041 | static void netdata_aspnet_error_events_raised(struct aspnet_app *aa, char *app, int update_every) |
| 1042 | { |
| 1043 | if (unlikely(!aa->st_aspnet_error_events_raised_per_sec)) { |
| 1044 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1045 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_error_events_raised_per_sec", app); |
| 1046 | |
| 1047 | aa->st_aspnet_error_events_raised_per_sec = rrdset_create_localhost( |
| 1048 | "aspnet", |
| 1049 | id, |
| 1050 | NULL, |
| 1051 | "aspnet", |
| 1052 | "aspnet.error_events_raised_per_sec", |
| 1053 | "Runtime error events raised.", |
| 1054 | "errors", |
| 1055 | PLUGIN_WINDOWS_NAME, |
| 1056 | "PerflibASP", |
| 1057 | PRIO_ASPNET_EVENTS_RAISED_PER_SEC, |
| 1058 | update_every, |
| 1059 | RRDSET_TYPE_LINE); |
| 1060 | |
| 1061 | aa->rd_aspnet_error_events_raised_per_sec = |
| 1062 | rrddim_add(aa->st_aspnet_error_events_raised_per_sec, "events", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1063 | |
| 1064 | rrdlabels_add(aa->st_aspnet_error_events_raised_per_sec->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1065 | } |
| 1066 | |
| 1067 | rrddim_set_by_pointer( |
| 1068 | aa->st_aspnet_error_events_raised_per_sec, |
| 1069 | aa->rd_aspnet_error_events_raised_per_sec, |
| 1070 | (collected_number)aa->aspnetErrorEventsRaisedPerSec.current.Data); |
| 1071 | rrdset_done(aa->st_aspnet_error_events_raised_per_sec); |
| 1072 | } |
| 1073 | |
| 1074 | static void netdata_aspnet_events_audit_success(struct aspnet_app *aa, char *app, int update_every) |
| 1075 | { |
| 1076 | if (unlikely(!aa->st_aspnet_audit_success_events_raised)) { |
| 1077 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1078 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_events_audit_success", app); |
| 1079 | |
| 1080 | aa->st_aspnet_audit_success_events_raised = rrdset_create_localhost( |
| 1081 | "aspnet", |
| 1082 | id, |
| 1083 | NULL, |
| 1084 | "aspnet", |
| 1085 | "aspnet.events_audit_success", |
| 1086 | "Audit successes in the application.", |
| 1087 | "errors", |
| 1088 | PLUGIN_WINDOWS_NAME, |
| 1089 | "PerflibASP", |
| 1090 | PRIO_ASPNET_AUDIT_SUCCESS_EVENTS_RAISED, |
| 1091 | update_every, |
| 1092 | RRDSET_TYPE_LINE); |
| 1093 | |
| 1094 | aa->rd_aspnet_audit_success_events_raised = |
| 1095 | rrddim_add(aa->st_aspnet_audit_success_events_raised, "events", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1096 | |
| 1097 | rrdlabels_add(aa->st_aspnet_audit_success_events_raised->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1098 | } |
| 1099 | |
| 1100 | rrddim_set_by_pointer( |
| 1101 | aa->st_aspnet_audit_success_events_raised, |
| 1102 | aa->rd_aspnet_audit_success_events_raised, |
| 1103 | (collected_number)aa->aspnetAuditSuccessEventsRaised.current.Data); |
| 1104 | rrdset_done(aa->st_aspnet_audit_success_events_raised); |
| 1105 | } |
| 1106 | |
| 1107 | static void netdata_aspnet_events_audit_failure(struct aspnet_app *aa, char *app, int update_every) |
| 1108 | { |
| 1109 | if (unlikely(!aa->st_aspnet_audit_failures_events_raised)) { |
| 1110 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1111 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_events_audit_failure", app); |
| 1112 | |
| 1113 | aa->st_aspnet_audit_failures_events_raised = rrdset_create_localhost( |
| 1114 | "aspnet", |
| 1115 | id, |
| 1116 | NULL, |
| 1117 | "aspnet", |
| 1118 | "aspnet.events_audit_failure", |
| 1119 | "Audit Failure Events Raised", |
| 1120 | "failures", |
| 1121 | PLUGIN_WINDOWS_NAME, |
| 1122 | "PerflibASP", |
| 1123 | PRIO_ASPNET_AUDIT_FAILURES_EVENTS_RAISED, |
| 1124 | update_every, |
| 1125 | RRDSET_TYPE_LINE); |
| 1126 | |
| 1127 | aa->rd_aspnet_audit_failures_events_raised = |
| 1128 | rrddim_add(aa->st_aspnet_audit_failures_events_raised, "audit", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); |
| 1129 | |
| 1130 | rrdlabels_add(aa->st_aspnet_audit_failures_events_raised->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1131 | } |
| 1132 | |
| 1133 | rrddim_set_by_pointer( |
| 1134 | aa->st_aspnet_audit_failures_events_raised, |
| 1135 | aa->rd_aspnet_audit_failures_events_raised, |
| 1136 | (collected_number)aa->aspnetAuditFailuresEventsRaised.current.Data); |
| 1137 | rrdset_done(aa->st_aspnet_audit_failures_events_raised); |
| 1138 | } |
| 1139 | |
| 1140 | static inline void netdata_aspnet_apps_events( |
| 1141 | PERF_DATA_BLOCK *pDataBlock, |
| 1142 | PERF_OBJECT_TYPE *pObjectType, |
| 1143 | struct aspnet_app *aa, |
| 1144 | int update_every) |
| 1145 | { |
| 1146 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetEventsRaisedPerSec)) |
| 1147 | netdata_aspnet_events_raised(aa, windows_shared_buffer, update_every); |
| 1148 | |
| 1149 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetErrorEventsRaisedPerSec)) |
| 1150 | netdata_aspnet_error_events_raised(aa, windows_shared_buffer, update_every); |
| 1151 | |
| 1152 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetAuditSuccessEventsRaised)) |
| 1153 | netdata_aspnet_events_audit_success(aa, windows_shared_buffer, update_every); |
| 1154 | |
| 1155 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetAuditFailuresEventsRaised)) |
| 1156 | netdata_aspnet_events_audit_failure(aa, windows_shared_buffer, update_every); |
| 1157 | } |
| 1158 | |
| 1159 | static void netdata_aspnet_membership_authentication_success(struct aspnet_app *aa, char *app, int update_every) |
| 1160 | { |
| 1161 | if (unlikely(!aa->st_aspnet_membership_authentication_success)) { |
| 1162 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1163 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_membership_auth_success", app); |
| 1164 | |
| 1165 | aa->st_aspnet_membership_authentication_success = rrdset_create_localhost( |
| 1166 | "aspnet", |
| 1167 | id, |
| 1168 | NULL, |
| 1169 | "aspnet", |
| 1170 | "aspnet.membership_auth_success", |
| 1171 | "Membership Authentication Success.", |
| 1172 | "auth", |
| 1173 | PLUGIN_WINDOWS_NAME, |
| 1174 | "PerflibASP", |
| 1175 | PRIO_ASPNET_MEMBERSHIP_AUTHENTICATION_SUCCESS, |
| 1176 | update_every, |
| 1177 | RRDSET_TYPE_LINE); |
| 1178 | |
| 1179 | aa->rd_aspnet_membership_authentication_success = |
| 1180 | rrddim_add(aa->st_aspnet_membership_authentication_success, "success", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1181 | |
| 1182 | rrdlabels_add(aa->st_aspnet_membership_authentication_success->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1183 | } |
| 1184 | |
| 1185 | rrddim_set_by_pointer( |
| 1186 | aa->st_aspnet_membership_authentication_success, |
| 1187 | aa->rd_aspnet_membership_authentication_success, |
| 1188 | (collected_number)aa->aspnetMembershipAuthenticationSuccess.current.Data); |
| 1189 | rrdset_done(aa->st_aspnet_membership_authentication_success); |
| 1190 | } |
| 1191 | |
| 1192 | static void netdata_aspnet_membership_authentication_failure(struct aspnet_app *aa, char *app, int update_every) |
| 1193 | { |
| 1194 | if (unlikely(!aa->st_aspnet_membership_authentication_failure)) { |
| 1195 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1196 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_membership_auth_failure", app); |
| 1197 | |
| 1198 | aa->st_aspnet_membership_authentication_failure = rrdset_create_localhost( |
| 1199 | "aspnet", |
| 1200 | id, |
| 1201 | NULL, |
| 1202 | "aspnet", |
| 1203 | "aspnet.membership_auth_failure", |
| 1204 | "Membership Authentication Failure.", |
| 1205 | "auth", |
| 1206 | PLUGIN_WINDOWS_NAME, |
| 1207 | "PerflibASP", |
| 1208 | PRIO_ASPNET_MEMBERSHIP_AUTHENTICATION_FAILURE, |
| 1209 | update_every, |
| 1210 | RRDSET_TYPE_LINE); |
| 1211 | |
| 1212 | aa->rd_aspnet_membership_authentication_failure = |
| 1213 | rrddim_add(aa->st_aspnet_membership_authentication_failure, "failure", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1214 | |
| 1215 | rrdlabels_add(aa->st_aspnet_membership_authentication_failure->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1216 | } |
| 1217 | |
| 1218 | rrddim_set_by_pointer( |
| 1219 | aa->st_aspnet_membership_authentication_failure, |
| 1220 | aa->rd_aspnet_membership_authentication_failure, |
| 1221 | (collected_number)aa->aspnetMembershipAuthenticationFailure.current.Data); |
| 1222 | rrdset_done(aa->st_aspnet_membership_authentication_failure); |
| 1223 | } |
| 1224 | |
| 1225 | static void netdata_aspnet_form_authentication_success(struct aspnet_app *aa, char *app, int update_every) |
| 1226 | { |
| 1227 | if (unlikely(!aa->st_aspnet_form_authentication_success)) { |
| 1228 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1229 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_form_authentication_success", app); |
| 1230 | |
| 1231 | aa->st_aspnet_form_authentication_success = rrdset_create_localhost( |
| 1232 | "aspnet", |
| 1233 | id, |
| 1234 | NULL, |
| 1235 | "aspnet", |
| 1236 | "aspnet.form_authentication_success", |
| 1237 | "Forms Authentication Success.", |
| 1238 | "auth", |
| 1239 | PLUGIN_WINDOWS_NAME, |
| 1240 | "PerflibASP", |
| 1241 | PRIO_ASPNET_FORM_AUTHENTICATION_SUCCESS, |
| 1242 | update_every, |
| 1243 | RRDSET_TYPE_LINE); |
| 1244 | |
| 1245 | aa->rd_aspnet_form_authentication_success = |
| 1246 | rrddim_add(aa->st_aspnet_form_authentication_success, "success", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1247 | |
| 1248 | rrdlabels_add(aa->st_aspnet_form_authentication_success->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1249 | } |
| 1250 | |
| 1251 | rrddim_set_by_pointer( |
| 1252 | aa->st_aspnet_form_authentication_success, |
| 1253 | aa->rd_aspnet_form_authentication_success, |
| 1254 | (collected_number)aa->aspnetFormAuthenticationSuccess.current.Data); |
| 1255 | rrdset_done(aa->st_aspnet_form_authentication_success); |
| 1256 | } |
| 1257 | |
| 1258 | static void netdata_aspnet_form_authentication_failure(struct aspnet_app *aa, char *app, int update_every) |
| 1259 | { |
| 1260 | if (unlikely(!aa->st_aspnet_form_authentication_failure)) { |
| 1261 | char id[RRD_ID_LENGTH_MAX + 1]; |
| 1262 | snprintfz(id, RRD_ID_LENGTH_MAX, "aspnet_app_%s_form_authentication_failure", app); |
| 1263 | |
| 1264 | aa->st_aspnet_form_authentication_failure = rrdset_create_localhost( |
| 1265 | "aspnet", |
| 1266 | id, |
| 1267 | NULL, |
| 1268 | "aspnet", |
| 1269 | "aspnet.form_authentication_failure", |
| 1270 | "Forms Authentication Failure.", |
| 1271 | "auth", |
| 1272 | PLUGIN_WINDOWS_NAME, |
| 1273 | "PerflibASP", |
| 1274 | PRIO_ASPNET_FORM_AUTHENTICATION_FAILURE, |
| 1275 | update_every, |
| 1276 | RRDSET_TYPE_LINE); |
| 1277 | |
| 1278 | aa->rd_aspnet_form_authentication_failure = |
| 1279 | rrddim_add(aa->st_aspnet_form_authentication_failure, "failure", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); |
| 1280 | |
| 1281 | rrdlabels_add(aa->st_aspnet_form_authentication_failure->rrdlabels, "aspnet_app", app, RRDLABEL_SRC_AUTO); |
| 1282 | } |
| 1283 | |
| 1284 | rrddim_set_by_pointer( |
| 1285 | aa->st_aspnet_form_authentication_failure, |
| 1286 | aa->rd_aspnet_form_authentication_failure, |
| 1287 | (collected_number)aa->aspnetFormAuthenticationFailure.current.Data); |
| 1288 | rrdset_done(aa->st_aspnet_form_authentication_failure); |
| 1289 | } |
| 1290 | |
| 1291 | static inline void netdata_aspnet_apps_auth( |
| 1292 | PERF_DATA_BLOCK *pDataBlock, |
| 1293 | PERF_OBJECT_TYPE *pObjectType, |
| 1294 | struct aspnet_app *aa, |
| 1295 | int update_every) |
| 1296 | { |
| 1297 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetMembershipAuthenticationSuccess)) |
| 1298 | netdata_aspnet_membership_authentication_success(aa, windows_shared_buffer, update_every); |
| 1299 | |
| 1300 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetMembershipAuthenticationFailure)) |
| 1301 | netdata_aspnet_membership_authentication_failure(aa, windows_shared_buffer, update_every); |
| 1302 | |
| 1303 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetFormAuthenticationSuccess)) |
| 1304 | netdata_aspnet_form_authentication_success(aa, windows_shared_buffer, update_every); |
| 1305 | |
| 1306 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetFormAuthenticationFailure)) |
| 1307 | netdata_aspnet_form_authentication_failure(aa, windows_shared_buffer, update_every); |
| 1308 | } |
| 1309 | |
| 1310 | static void netdata_aspnet_apps_objects(PERF_DATA_BLOCK *pDataBlock, PERF_OBJECT_TYPE *pObjectType, int update_every) |
| 1311 | { |
| 1312 | PERF_INSTANCE_DEFINITION *pi = NULL; |
| 1313 | for (LONG i = 0; i < pObjectType->NumInstances; i++) { |
| 1314 | pi = perflibForEachInstance(pDataBlock, pObjectType, pi); |
| 1315 | if (!pi) |
| 1316 | break; |
| 1317 | |
| 1318 | if (!getInstanceName(pDataBlock, pObjectType, pi, windows_shared_buffer, sizeof(windows_shared_buffer))) |
| 1319 | strncpyz(windows_shared_buffer, "[unknown]", sizeof(windows_shared_buffer) - 1); |
| 1320 | |
| 1321 | if (strcasecmp(windows_shared_buffer, "__Total__") == 0) |
| 1322 | continue; |
| 1323 | |
| 1324 | struct aspnet_app *aa = dictionary_set(aspnet_apps, windows_shared_buffer, NULL, sizeof(*aa)); |
| 1325 | if (!aa) |
| 1326 | continue; |
| 1327 | |
| 1328 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetAnonymousRequestPerSec)) |
| 1329 | netdata_aspnet_anonymous_request(aa, windows_shared_buffer, update_every); |
| 1330 | |
| 1331 | if (perflibGetObjectCounter(pDataBlock, pObjectType, &aa->aspnetCompilationsTotal)) |
| 1332 | netdata_aspnet_compilations_total(aa, windows_shared_buffer, update_every); |
| 1333 | |
| 1334 | netdata_aspnet_apps_runtime_errors(pDataBlock, pObjectType, aa, update_every); |
| 1335 | |
| 1336 | netdata_aspnet_apps_requests(pDataBlock, pObjectType, aa, update_every); |
| 1337 | |
| 1338 | netdata_aspnet_apps_sessions(pDataBlock, pObjectType, aa, update_every); |
| 1339 | |
| 1340 | netdata_aspnet_apps_transactions(pDataBlock, pObjectType, aa, update_every); |
| 1341 | |
| 1342 | netdata_aspnet_apps_events(pDataBlock, pObjectType, aa, update_every); |
| 1343 | |
| 1344 | netdata_aspnet_apps_auth(pDataBlock, pObjectType, aa, update_every); |
| 1345 | } |
| 1346 | } |
| 1347 | |
| 1348 | struct netdata_exchange_objects { |
| 1349 | void (*fnct)(PERF_DATA_BLOCK *, PERF_OBJECT_TYPE *, int); |
| 1350 | char *object; |
| 1351 | } asp_obj[] = { |
| 1352 | {.fnct = netdata_aspnet_global_objects, .object = "ASP.NET"}, |
| 1353 | {.fnct = netdata_aspnet_apps_objects, .object = "ASP.NET Applications"}, |
| 1354 | |
| 1355 | // This is the end of the loop |
| 1356 | {.fnct = NULL, .object = NULL} |
| 1357 | }; |
| 1358 | |
| 1359 | int do_PerflibASP(int update_every, usec_t dt __maybe_unused) |
| 1360 | { |
| 1361 | static bool initialized = false; |
| 1362 | |
| 1363 | if (unlikely(!initialized)) { |
| 1364 | initialize(); |
| 1365 | initialized = true; |
| 1366 | } |
| 1367 | |
| 1368 | for (LONG i = 0; asp_obj[i].fnct; i++) { |
| 1369 | DWORD id = RegistryFindIDByName(asp_obj[i].object); |
| 1370 | if (id == PERFLIB_REGISTRY_NAME_NOT_FOUND) |
| 1371 | continue; |
| 1372 | |
| 1373 | PERF_DATA_BLOCK *pDataBlock = perflibGetPerformanceData(id); |
| 1374 | if (!pDataBlock) |
| 1375 | continue; |
| 1376 | |
| 1377 | PERF_OBJECT_TYPE *pObjectType = perflibFindObjectTypeByName(pDataBlock, asp_obj[i].object); |
| 1378 | if (!pObjectType) |
| 1379 | continue; |
| 1380 | |
| 1381 | asp_obj[i].fnct(pDataBlock, pObjectType, update_every); |
| 1382 | } |
| 1383 | |
| 1384 | return 0; |
| 1385 | } |