@cryptotaxi247 / netdata-1 / commits / 2e569e333

Address Chart name (Windows Hyper V) (#20060)

thiagoftsm committed Apr 8, 2025 at 04:03 UTC 2e569e3333080bb2a35cff7a54e530450594516d
1 file changed +44 -18
src/collectors/windows.plugin/perflib-hyperv.c
+44 -18
@@ -26,7 +26,7 @@ static void get_and_sanitize_instance_value(
26
27 #define DICT_PERF_OPTION (DICT_OPTION_DONT_OVERWRITE_VALUE | DICT_OPTION_FIXED_SIZE)
28
29 -#define DEFINE_RD(counter_name) RRDDIM *rd_##counter_name
29 +#define DEFINE_RD(counter_name) RRDDIM(*rd_##counter_name)
30
31 #define GET_INSTANCE_COUNTER(counter) \
32 do { \
@@ -142,10 +142,14 @@ static bool do_hyperv_memory(PERF_DATA_BLOCK *pDataBlock, int update_every, void
142
143 if (!p->charts_created) {
144 p->charts_created = true;
145 + char id[RRD_ID_LENGTH_MAX + 1];
146 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
147 + netdata_fix_chart_name(id);
148 +
149 if (!p->st_vm_memory_physical) {
150 p->st_vm_memory_physical = rrdset_create_localhost(
151 "vm_memory_physical",
148 - windows_shared_buffer,
152 + id,
153 NULL,
154 HYPERV,
155 HYPERV ".vm_memory_physical",
@@ -246,10 +250,13 @@ static bool do_hyperv_vid_partition(PERF_DATA_BLOCK *pDataBlock, int update_ever
250
251 if (!p->charts_created) {
252 p->charts_created = true;
253 + char id[RRD_ID_LENGTH_MAX + 1];
254 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
255 + netdata_fix_chart_name(id);
256
257 p->st_vm_vid_physical_pages_allocated = rrdset_create_localhost(
258 "vm_vid_physical_pages_allocated",
252 - windows_shared_buffer,
259 + id,
260 NULL,
261 HYPERV,
262 HYPERV ".vm_vid_physical_pages_allocated",
@@ -332,7 +339,7 @@ static bool do_hyperv_health_summary(PERF_DATA_BLOCK *pDataBlock, int update_eve
339 p->charts_created = true;
340 p->st_health = rrdset_create_localhost(
341 "vms_health",
335 - windows_shared_buffer,
342 + "hyperv_health_status",
343 NULL,
344 HYPERV,
345 HYPERV ".vms_health",
@@ -369,7 +376,7 @@ struct hypervisor_root_partition {
376 RRDSET *st_DeviceDMAErrors;
377 RRDSET *st_DeviceInterruptErrors;
378 RRDSET *st_DeviceInterruptThrottleEvents;
372 - RRDSET *st_IOΤLBFlushesSec;
379 + RRDSET *st_IOTLBFlushesSec;
380 RRDSET *st_AddressSpaces;
381 RRDSET *st_VirtualTLBPages;
382 RRDSET *st_VirtualTLBFlushEntiresSec;
@@ -388,7 +395,7 @@ struct hypervisor_root_partition {
395 DEFINE_RD(DeviceDMAErrors);
396 DEFINE_RD(DeviceInterruptErrors);
397 DEFINE_RD(DeviceInterruptThrottleEvents);
391 - DEFINE_RD(IOΤLBFlushesSec);
398 + DEFINE_RD(IOTLBFlushesSec);
399 DEFINE_RD(AddressSpaces);
400 DEFINE_RD(VirtualTLBPages);
401 DEFINE_RD(VirtualTLBFlushEntiresSec);
@@ -405,7 +412,7 @@ struct hypervisor_root_partition {
412 COUNTER_DATA DeviceDMAErrors;
413 COUNTER_DATA DeviceInterruptErrors;
414 COUNTER_DATA DeviceInterruptThrottleEvents;
408 - COUNTER_DATA IOΤLBFlushesSec;
415 + COUNTER_DATA IOTLBFlushesSec;
416 COUNTER_DATA AddressSpaces;
417 COUNTER_DATA VirtualTLBPages;
418 COUNTER_DATA VirtualTLBFlushEntiresSec;
@@ -429,7 +436,7 @@ void initialize_hyperv_root_partition_keys(struct hypervisor_root_partition *p)
436 p->DeviceDMAErrors.key = "Device DMA Errors";
437 p->DeviceInterruptErrors.key = "Device Interrupt Errors";
438 p->DeviceInterruptThrottleEvents.key = "Device Interrupt Throttle Events";
432 - p->IOΤLBFlushesSec.key = "I/O TLB Flushes/sec";
439 + p->IOTLBFlushesSec.key = "I/O TLB Flushes/sec";
440 p->AddressSpaces.key = "Address Spaces";
441 p->VirtualTLBPages.key = "Virtual TLB Pages";
442 p->VirtualTLBFlushEntiresSec.key = "Virtual TLB Flush Entires/sec";
@@ -486,7 +493,7 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
493 GET_INSTANCE_COUNTER(DeviceDMAErrors);
494 GET_INSTANCE_COUNTER(DeviceInterruptErrors);
495 GET_INSTANCE_COUNTER(DeviceInterruptThrottleEvents);
489 - GET_INSTANCE_COUNTER(IOΤLBFlushesSec);
496 + GET_INSTANCE_COUNTER(IOTLBFlushesSec);
497 GET_INSTANCE_COUNTER(AddressSpaces);
498 GET_INSTANCE_COUNTER(VirtualTLBPages);
499 GET_INSTANCE_COUNTER(VirtualTLBFlushEntiresSec);
@@ -494,9 +501,13 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
501 // Create charts
502 if (!p->charts_created) {
503 p->charts_created = true;
504 + char id[RRD_ID_LENGTH_MAX + 1];
505 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
506 + netdata_fix_chart_name(id);
507 +
508 p->st_device_space_pages = rrdset_create_localhost(
509 "root_partition_device_space_pages",
499 - windows_shared_buffer,
510 + id,
511 NULL,
512 HYPERV,
513 HYPERV ".root_partition_device_space_pages",
@@ -630,7 +641,7 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
641 p->rd_DeviceInterruptThrottleEvents =
642 rrddim_add(p->st_DeviceInterruptThrottleEvents, "throttling", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE);
643
633 - p->st_IOΤLBFlushesSec = rrdset_create_localhost(
644 + p->st_IOTLBFlushesSec = rrdset_create_localhost(
645 "root_partition_io_tlb_flush",
646 windows_shared_buffer,
647 NULL,
@@ -644,7 +655,7 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
655 update_every,
656 RRDSET_TYPE_LINE);
657
647 - p->rd_IOΤLBFlushesSec = rrddim_add(p->st_IOΤLBFlushesSec, "gpa", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
658 + p->rd_IOTLBFlushesSec = rrddim_add(p->st_IOTLBFlushesSec, "gpa", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
659
660 p->st_AddressSpaces = rrdset_create_localhost(
661 "root_partition_address_space",
@@ -714,7 +725,7 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
725 SETP_DIM_VALUE(st_DeviceDMAErrors, DeviceDMAErrors);
726 SETP_DIM_VALUE(st_DeviceInterruptErrors, DeviceInterruptErrors);
727 SETP_DIM_VALUE(st_DeviceInterruptThrottleEvents, DeviceInterruptThrottleEvents);
717 - SETP_DIM_VALUE(st_IOΤLBFlushesSec, IOΤLBFlushesSec);
728 + SETP_DIM_VALUE(st_IOTLBFlushesSec, IOTLBFlushesSec);
729 SETP_DIM_VALUE(st_AddressSpaces, AddressSpaces);
730 SETP_DIM_VALUE(st_VirtualTLBPages, VirtualTLBPages);
731 SETP_DIM_VALUE(st_VirtualTLBFlushEntiresSec, VirtualTLBFlushEntiresSec);
@@ -727,7 +738,7 @@ static bool do_hyperv_root_partition(PERF_DATA_BLOCK *pDataBlock, int update_eve
738 rrdset_done(p->st_deposited_pages);
739 rrdset_done(p->st_DeviceInterruptErrors);
740 rrdset_done(p->st_DeviceInterruptThrottleEvents);
730 - rrdset_done(p->st_IOΤLBFlushesSec);
741 + rrdset_done(p->st_IOTLBFlushesSec);
742 rrdset_done(p->st_AddressSpaces);
743 rrdset_done(p->st_DeviceDMAErrors);
744 rrdset_done(p->st_VirtualTLBPages);
@@ -819,10 +830,14 @@ static bool do_hyperv_storage_device(PERF_DATA_BLOCK *pDataBlock, int update_eve
830
831 if (!p->charts_created) {
832 p->charts_created = true;
833 + char id[RRD_ID_LENGTH_MAX + 1];
834 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
835 + netdata_fix_chart_name(id);
836 +
837 if (!p->st_operations) {
838 p->st_operations = rrdset_create_localhost(
839 "vm_storage_device_operations",
825 - windows_shared_buffer,
840 + id,
841 NULL,
842 HYPERV,
843 HYPERV ".vm_storage_device_operations",
@@ -1054,10 +1069,13 @@ static bool do_hyperv_switch(PERF_DATA_BLOCK *pDataBlock, int update_every, void
1069
1070 if (!p->charts_created) {
1071 p->charts_created = true;
1072 + char id[RRD_ID_LENGTH_MAX + 1];
1073 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
1074 + netdata_fix_chart_name(id);
1075
1076 p->st_bytes = rrdset_create_localhost(
1077 "vswitch_traffic",
1060 - windows_shared_buffer,
1078 + id,
1079 NULL,
1080 HYPERV,
1081 HYPERV ".vswitch_traffic",
@@ -1418,9 +1436,13 @@ static bool do_hyperv_network_adapter(PERF_DATA_BLOCK *pDataBlock, int update_ev
1436
1437 if (!p->charts_created) {
1438 p->charts_created = true;
1439 + char id[RRD_ID_LENGTH_MAX + 1];
1440 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
1441 + netdata_fix_chart_name(id);
1442 +
1443 p->st_dropped_packets = rrdset_create_localhost(
1444 "vm_net_interface_packets_dropped",
1423 - windows_shared_buffer,
1445 + id,
1446 NULL,
1447 HYPERV,
1448 HYPERV ".vm_net_interface_packets_dropped",
@@ -1679,9 +1701,13 @@ static bool do_hyperv_processor(PERF_DATA_BLOCK *pDataBlock, int update_every, v
1701
1702 if (!p->charts_created) {
1703 p->charts_created = true;
1704 + char id[RRD_ID_LENGTH_MAX + 1];
1705 + snprintfz(id, RRD_ID_LENGTH_MAX, "%s", windows_shared_buffer);
1706 + netdata_fix_chart_name(id);
1707 +
1708 p->st_HypervisorProcessorTotal = rrdset_create_localhost(
1709 "vm_cpu_usage",
1684 - windows_shared_buffer,
1710 + id,
1711 NULL,
1712 HYPERV,
1713 HYPERV ".vm_cpu_usage",