Browse Source

improvement(windows/iis): add requests by type chart (#19028)

(cherry picked from commit d5e61abf0d582c2ea1275554c41c87fec3fa219b)
Stelios Fragkakis 1 day ago
parent
commit
86514d5f72

+ 128 - 6
src/collectors/windows.plugin/perflib-web-service.c

@@ -4,6 +4,27 @@
 #include "windows-internals.h"
 #include "windows-internals.h"
 
 
 struct web_service {
 struct web_service {
+    RRDSET *st_request_rate;
+    RRDDIM *rd_request_rate;
+
+    RRDSET *st_request_by_type_rate;
+    RRDDIM *rd_request_options_rate;
+    RRDDIM *rd_request_get_rate;
+    RRDDIM *rd_request_post_rate;
+    RRDDIM *rd_request_head_rate;
+    RRDDIM *rd_request_put_rate;
+    RRDDIM *rd_request_delete_rate;
+    RRDDIM *rd_request_trace_rate;
+    RRDDIM *rd_request_move_rate;
+    RRDDIM *rd_request_copy_rate;
+    RRDDIM *rd_request_mkcol_rate;
+    RRDDIM *rd_request_propfind_rate;
+    RRDDIM *rd_request_proppatch_rate;
+    RRDDIM *rd_request_search_rate;
+    RRDDIM *rd_request_lock_rate;
+    RRDDIM *rd_request_unlock_rate;
+    RRDDIM *rd_request_other_rate;
+
     RRDSET *st_traffic;
     RRDSET *st_traffic;
     RRDDIM *rd_traffic_received;
     RRDDIM *rd_traffic_received;
     RRDDIM *rd_traffic_sent;
     RRDDIM *rd_traffic_sent;
@@ -38,9 +59,6 @@ struct web_service {
     RRDSET *st_service_uptime;
     RRDSET *st_service_uptime;
     RRDDIM *rd_service_uptime;
     RRDDIM *rd_service_uptime;
 
 
-    RRDSET *st_request_rate;
-    RRDDIM *rd_request_rate;
-
     COUNTER_DATA IISCurrentAnonymousUser;
     COUNTER_DATA IISCurrentAnonymousUser;
     COUNTER_DATA IISCurrentNonAnonymousUsers;
     COUNTER_DATA IISCurrentNonAnonymousUsers;
     COUNTER_DATA IISCurrentConnections;
     COUNTER_DATA IISCurrentConnections;
@@ -292,9 +310,9 @@ static bool do_web_services(PERF_DATA_BLOCK *pDataBlock, int update_every) {
                     update_every,
                     update_every,
                     RRDSET_TYPE_STACKED);
                     RRDSET_TYPE_STACKED);
 
 
-                p->rd_user_anonymous = rrddim_add(p->st_user_count, "anonymous", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_user_anonymous = rrddim_add(p->st_user_count, "anonymous", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
                 p->rd_user_nonanonymous =
                 p->rd_user_nonanonymous =
-                    rrddim_add(p->st_user_count, "non_anonymous", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                    rrddim_add(p->st_user_count, "non_anonymous", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
 
 
                 rrdlabels_add(p->st_user_count->rrdlabels, "website", windows_shared_buffer, RRDLABEL_SRC_AUTO);
                 rrdlabels_add(p->st_user_count->rrdlabels, "website", windows_shared_buffer, RRDLABEL_SRC_AUTO);
             }
             }
@@ -503,7 +521,7 @@ static bool do_web_services(PERF_DATA_BLOCK *pDataBlock, int update_every) {
                     update_every,
                     update_every,
                     RRDSET_TYPE_LINE);
                     RRDSET_TYPE_LINE);
 
 
-                p->rd_request_rate = rrddim_add(p->st_request_rate, "requests", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
+                p->rd_request_rate = rrddim_add(p->st_request_rate, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
 
 
                 rrdlabels_add(p->st_request_rate->rrdlabels, "website", windows_shared_buffer, RRDLABEL_SRC_AUTO);
                 rrdlabels_add(p->st_request_rate->rrdlabels, "website", windows_shared_buffer, RRDLABEL_SRC_AUTO);
             }
             }
@@ -519,6 +537,110 @@ static bool do_web_services(PERF_DATA_BLOCK *pDataBlock, int update_every) {
             rrddim_set_by_pointer(p->st_request_rate, p->rd_request_rate, (collected_number)requests);
             rrddim_set_by_pointer(p->st_request_rate, p->rd_request_rate, (collected_number)requests);
 
 
             rrdset_done(p->st_request_rate);
             rrdset_done(p->st_request_rate);
+
+            if (!p->st_request_by_type_rate) {
+                snprintfz(id, RRD_ID_LENGTH_MAX, "website_%s_requests_by_type_rate", windows_shared_buffer);
+                netdata_fix_chart_name(id);
+                p->st_request_by_type_rate = rrdset_create_localhost(
+                    "iis",
+                    id,
+                    NULL,
+                    "requests",
+                    "iis.website_requests_by_type_rate",
+                    "Website requests rate",
+                    "requests/s",
+                    PLUGIN_WINDOWS_NAME,
+                    "PerflibWebService",
+                    PRIO_WEBSITE_IIS_REQUESTS_BY_TYPE_RATE,
+                    update_every,
+                    RRDSET_TYPE_STACKED);
+
+                p->rd_request_options_rate = rrddim_add(p->st_request_by_type_rate, "options", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_get_rate = rrddim_add(p->st_request_by_type_rate, "get", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_post_rate = rrddim_add(p->st_request_by_type_rate, "post", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_head_rate = rrddim_add(p->st_request_by_type_rate, "head", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_put_rate = rrddim_add(p->st_request_by_type_rate, "put", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_delete_rate = rrddim_add(p->st_request_by_type_rate, "delete", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_trace_rate = rrddim_add(p->st_request_by_type_rate, "trace", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_move_rate = rrddim_add(p->st_request_by_type_rate, "move", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_copy_rate = rrddim_add(p->st_request_by_type_rate, "copy", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_mkcol_rate = rrddim_add(p->st_request_by_type_rate, "mkcol", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_propfind_rate = rrddim_add(p->st_request_by_type_rate, "propfind", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_proppatch_rate = rrddim_add(p->st_request_by_type_rate, "proppatch", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_search_rate = rrddim_add(p->st_request_by_type_rate, "search", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_lock_rate = rrddim_add(p->st_request_by_type_rate, "lock", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_unlock_rate = rrddim_add(p->st_request_by_type_rate, "unlock", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+                p->rd_request_other_rate = rrddim_add(p->st_request_by_type_rate, "other", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
+
+                rrdlabels_add(p->st_request_by_type_rate->rrdlabels, "website", windows_shared_buffer, RRDLABEL_SRC_AUTO);
+            }
+
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_options_rate,
+                (collected_number)p->IISRequestsOptions.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_get_rate,
+                (collected_number)p->IISRequestsGet.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_post_rate,
+                (collected_number)p->IISRequestsPost.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_head_rate,
+                (collected_number)p->IISRequestsHead.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_put_rate,
+                (collected_number)p->IISRequestsPut.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_delete_rate,
+                (collected_number)p->IISRequestsDelete.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_trace_rate,
+                (collected_number)p->IISRequestsTrace.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_move_rate,
+                (collected_number)p->IISRequestsMove.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_copy_rate,
+                (collected_number)p->IISRequestsCopy.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_mkcol_rate,
+                (collected_number)p->IISRequestsMkcol.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_propfind_rate,
+                (collected_number)p->IISRequestsPropfind.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_proppatch_rate,
+                (collected_number)p->IISRequestsProppatch.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_search_rate,
+                (collected_number)p->IISRequestsSearch.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_lock_rate,
+                (collected_number)p->IISRequestsLock.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_unlock_rate,
+                (collected_number)p->IISRequestsUnlock.current.Data);
+            rrddim_set_by_pointer(
+                p->st_request_by_type_rate,
+                p->rd_request_other_rate,
+                (collected_number)p->IISRequestsOther.current.Data);
+
+            rrdset_done(p->st_request_by_type_rate);
         }
         }
     }
     }
 
 

+ 3 - 2
src/collectors/windows.plugin/windows_plugin.h

@@ -30,10 +30,11 @@ int do_PerflibMSSQL(int update_every, usec_t dt);
 int do_PerflibNetFramework(int update_every, usec_t dt);
 int do_PerflibNetFramework(int update_every, usec_t dt);
 
 
 enum PERFLIB_PRIO {
 enum PERFLIB_PRIO {
-    PRIO_WEBSITE_IIS_TRAFFIC = 21000, // PRIO selected, because APPS is using 20YYY
+    PRIO_WEBSITE_IIS_REQUESTS_RATE = 21000, // PRIO selected, because APPS is using 20YYY
+    PRIO_WEBSITE_IIS_REQUESTS_BY_TYPE_RATE,
+    PRIO_WEBSITE_IIS_TRAFFIC,
     PRIO_WEBSITE_IIS_FTP_FILE_TRANSFER_RATE,
     PRIO_WEBSITE_IIS_FTP_FILE_TRANSFER_RATE,
     PRIO_WEBSITE_IIS_ACTIVE_CONNECTIONS_COUNT,
     PRIO_WEBSITE_IIS_ACTIVE_CONNECTIONS_COUNT,
-    PRIO_WEBSITE_IIS_REQUESTS_RATE,
     PRIO_WEBSITE_IIS_CONNECTIONS_ATTEMP,
     PRIO_WEBSITE_IIS_CONNECTIONS_ATTEMP,
     PRIO_WEBSITE_IIS_USERS,
     PRIO_WEBSITE_IIS_USERS,
     PRIO_WEBSITE_IIS_ISAPI_EXT_REQUEST_COUNT,
     PRIO_WEBSITE_IIS_ISAPI_EXT_REQUEST_COUNT,