github.com/netdata/go.d.plugin@v0.58.1/modules/windows/collect_netframework.go (about)

     1  // SPDX-License-Identifier: GPL-3.0-or-later
     2  
     3  package windows
     4  
     5  import (
     6  	"github.com/netdata/go.d.plugin/pkg/prometheus"
     7  )
     8  
     9  const (
    10  	netframeworkPrefix = "netframework_"
    11  )
    12  
    13  const (
    14  	metricNetFrameworkCLRExceptionsThrownTotal          = "windows_netframework_clrexceptions_exceptions_thrown_total"
    15  	metricNetFrameworkCLRExceptionsFiltersTotal         = "windows_netframework_clrexceptions_exceptions_filters_total"
    16  	metricNetFrameworkCLRExceptionsFinallysTotal        = "windows_netframework_clrexceptions_exceptions_finallys_total"
    17  	metricNetFrameworkCLRExceptionsThrowCatchDepthTotal = "windows_netframework_clrexceptions_throw_to_catch_depth_total"
    18  )
    19  
    20  func (w *Windows) collectNetFrameworkCLRExceptions(mx map[string]int64, pms prometheus.Series) {
    21  	seen := make(map[string]bool)
    22  
    23  	for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsThrownTotal) {
    24  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    25  			seen[name] = true
    26  			mx[netframeworkPrefix+name+"_clrexception_thrown_total"] += int64(pm.Value)
    27  		}
    28  	}
    29  
    30  	for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsFiltersTotal) {
    31  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    32  			seen[name] = true
    33  			mx[netframeworkPrefix+name+"_clrexception_filters_total"] += int64(pm.Value)
    34  		}
    35  	}
    36  
    37  	for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsFinallysTotal) {
    38  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    39  			seen[name] = true
    40  			mx[netframeworkPrefix+name+"_clrexception_finallys_total"] += int64(pm.Value)
    41  		}
    42  	}
    43  
    44  	for _, pm := range pms.FindByName(metricNetFrameworkCLRExceptionsThrowCatchDepthTotal) {
    45  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    46  			seen[name] = true
    47  			mx[netframeworkPrefix+name+"_clrexception_throw_to_catch_depth_total"] += int64(pm.Value)
    48  		}
    49  	}
    50  
    51  	for proc := range seen {
    52  		if !w.cache.netFrameworkCLRExceptions[proc] {
    53  			w.cache.netFrameworkCLRExceptions[proc] = true
    54  			w.addProcessNetFrameworkExceptionsCharts(proc)
    55  		}
    56  	}
    57  
    58  	for proc := range w.cache.netFrameworkCLRExceptions {
    59  		if !seen[proc] {
    60  			delete(w.cache.netFrameworkCLRExceptions, proc)
    61  			w.removeProcessFromNetFrameworkExceptionsCharts(proc)
    62  		}
    63  	}
    64  }
    65  
    66  const (
    67  	metricNetFrameworkCLRInteropComCallableWrappersTotal = "windows_netframework_clrinterop_com_callable_wrappers_total"
    68  	metricNetFrameworkCLRInteropMarshallingTotal         = "windows_netframework_clrinterop_interop_marshalling_total"
    69  	metricNetFrameworkCLRInteropStubsCreatedTotal        = "windows_netframework_clrinterop_interop_stubs_created_total"
    70  )
    71  
    72  func (w *Windows) collectNetFrameworkCLRInterop(mx map[string]int64, pms prometheus.Series) {
    73  	seen := make(map[string]bool)
    74  
    75  	for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropComCallableWrappersTotal) {
    76  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    77  			seen[name] = true
    78  			mx[netframeworkPrefix+name+"_clrinterop_com_callable_wrappers_total"] += int64(pm.Value)
    79  		}
    80  	}
    81  
    82  	for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropMarshallingTotal) {
    83  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    84  			seen[name] = true
    85  			mx[netframeworkPrefix+name+"_clrinterop_interop_marshalling_total"] += int64(pm.Value)
    86  		}
    87  	}
    88  
    89  	for _, pm := range pms.FindByName(metricNetFrameworkCLRInteropStubsCreatedTotal) {
    90  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
    91  			seen[name] = true
    92  			mx[netframeworkPrefix+name+"_clrinterop_interop_stubs_created_total"] += int64(pm.Value)
    93  		}
    94  	}
    95  
    96  	for proc := range seen {
    97  		if !w.cache.netFrameworkCLRInterops[proc] {
    98  			w.cache.netFrameworkCLRInterops[proc] = true
    99  			w.addProcessNetFrameworkInteropCharts(proc)
   100  		}
   101  	}
   102  
   103  	for proc := range w.cache.netFrameworkCLRInterops {
   104  		if !seen[proc] {
   105  			delete(w.cache.netFrameworkCLRInterops, proc)
   106  			w.removeProcessNetFrameworkInteropCharts(proc)
   107  		}
   108  	}
   109  }
   110  
   111  const (
   112  	metricNetFrameworkCLRJITMethodsTotal          = "windows_netframework_clrjit_jit_methods_total"
   113  	metricNetFrameworkCLRJITTimePercent           = "windows_netframework_clrjit_jit_time_percent"
   114  	metricNetFrameworkCLRJITStandardFailuresTotal = "windows_netframework_clrjit_jit_standard_failures_total"
   115  	metricNetFrameworkCLRJITILBytesTotal          = "windows_netframework_clrjit_jit_il_bytes_total"
   116  )
   117  
   118  func (w *Windows) collectNetFrameworkCLRJIT(mx map[string]int64, pms prometheus.Series) {
   119  	seen := make(map[string]bool)
   120  
   121  	for _, pm := range pms.FindByName(metricNetFrameworkCLRJITMethodsTotal) {
   122  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   123  			seen[name] = true
   124  			mx[netframeworkPrefix+name+"_clrjit_methods_total"] += int64(pm.Value)
   125  		}
   126  	}
   127  
   128  	for _, pm := range pms.FindByName(metricNetFrameworkCLRJITStandardFailuresTotal) {
   129  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   130  			seen[name] = true
   131  			mx[netframeworkPrefix+name+"_clrjit_standard_failures_total"] += int64(pm.Value)
   132  		}
   133  	}
   134  
   135  	for _, pm := range pms.FindByName(metricNetFrameworkCLRJITTimePercent) {
   136  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   137  			seen[name] = true
   138  			mx[netframeworkPrefix+name+"_clrjit_time_percent"] += int64(pm.Value)
   139  		}
   140  	}
   141  
   142  	for _, pm := range pms.FindByName(metricNetFrameworkCLRJITILBytesTotal) {
   143  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   144  			seen[name] = true
   145  			mx[netframeworkPrefix+name+"_clrjit_il_bytes_total"] += int64(pm.Value)
   146  		}
   147  	}
   148  
   149  	for proc := range seen {
   150  		if !w.cache.netFrameworkCLRJIT[proc] {
   151  			w.cache.netFrameworkCLRJIT[proc] = true
   152  			w.addProcessNetFrameworkJITCharts(proc)
   153  		}
   154  	}
   155  
   156  	for proc := range w.cache.netFrameworkCLRJIT {
   157  		if !seen[proc] {
   158  			delete(w.cache.netFrameworkCLRJIT, proc)
   159  			w.removeProcessNetFrameworkJITCharts(proc)
   160  		}
   161  	}
   162  }
   163  
   164  const (
   165  	metricNetFrameworkCLRLoadingLoaderHeapSizeBytes    = "windows_netframework_clrloading_loader_heap_size_bytes"
   166  	metricNetFrameworkCLRLoadingAppDomainLoadedTotal   = "windows_netframework_clrloading_appdomains_loaded_total"
   167  	metricNetFrameworkCLRLoadingAppDomainUnloadedTotal = "windows_netframework_clrloading_appdomains_unloaded_total"
   168  	metricNetFrameworkCLRLoadingAssembliesLoadedTotal  = "windows_netframework_clrloading_assemblies_loaded_total"
   169  	metricNetFrameworkCLRLoadingClassesLoadedTotal     = "windows_netframework_clrloading_classes_loaded_total"
   170  	metricNetFrameworkCLRLoadingClassLoadFailuresTotal = "windows_netframework_clrloading_class_load_failures_total"
   171  )
   172  
   173  func (w *Windows) collectNetFrameworkCLRLoading(mx map[string]int64, pms prometheus.Series) {
   174  	seen := make(map[string]bool)
   175  
   176  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingLoaderHeapSizeBytes) {
   177  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   178  			seen[name] = true
   179  			mx[netframeworkPrefix+name+"_clrloading_loader_heap_size_bytes"] += int64(pm.Value)
   180  		}
   181  	}
   182  
   183  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAppDomainLoadedTotal) {
   184  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   185  			seen[name] = true
   186  			mx[netframeworkPrefix+name+"_clrloading_appdomains_loaded_total"] += int64(pm.Value)
   187  		}
   188  	}
   189  
   190  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAppDomainUnloadedTotal) {
   191  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   192  			seen[name] = true
   193  			mx[netframeworkPrefix+name+"_clrloading_appdomains_unloaded_total"] += int64(pm.Value)
   194  		}
   195  	}
   196  
   197  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingAssembliesLoadedTotal) {
   198  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   199  			seen[name] = true
   200  			mx[netframeworkPrefix+name+"_clrloading_assemblies_loaded_total"] += int64(pm.Value)
   201  		}
   202  	}
   203  
   204  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingClassesLoadedTotal) {
   205  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   206  			seen[name] = true
   207  			mx[netframeworkPrefix+name+"_clrloading_classes_loaded_total"] += int64(pm.Value)
   208  		}
   209  	}
   210  
   211  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLoadingClassLoadFailuresTotal) {
   212  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   213  			seen[name] = true
   214  			mx[netframeworkPrefix+name+"_clrloading_class_load_failures_total"] += int64(pm.Value)
   215  		}
   216  	}
   217  
   218  	for proc := range seen {
   219  		if !w.cache.netFrameworkCLRLoading[proc] {
   220  			w.cache.netFrameworkCLRLoading[proc] = true
   221  			w.addProcessNetFrameworkLoadingCharts(proc)
   222  		}
   223  	}
   224  
   225  	for proc := range w.cache.netFrameworkCLRLoading {
   226  		if !seen[proc] {
   227  			delete(w.cache.netFrameworkCLRLoading, proc)
   228  			w.removeProcessNetFrameworkLoadingCharts(proc)
   229  		}
   230  	}
   231  }
   232  
   233  const (
   234  	metricNetFrameworkCLRLocksAndThreadsQueueLengthTotal       = "windows_netframework_clrlocksandthreads_queue_length_total"
   235  	metricNetFrameworkCLRLocksAndThreadsCurrentLogicalThreads  = "windows_netframework_clrlocksandthreads_current_logical_threads"
   236  	metricNetFrameworkCLRLocksAndThreadsPhysicalThreadsCurrent = "windows_netframework_clrlocksandthreads_physical_threads_current"
   237  	metricNetFrameworkCLRLocksAndThreadsRecognizedThreadsTotal = "windows_netframework_clrlocksandthreads_recognized_threads_total"
   238  	metricNetFrameworkCLRLocksAndThreadsContentionsTotal       = "windows_netframework_clrlocksandthreads_contentions_total"
   239  )
   240  
   241  func (w *Windows) collectNetFrameworkCLRLocksAndThreads(mx map[string]int64, pms prometheus.Series) {
   242  	seen := make(map[string]bool)
   243  
   244  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsQueueLengthTotal) {
   245  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   246  			seen[name] = true
   247  			mx[netframeworkPrefix+name+"_clrlocksandthreads_queue_length_total"] += int64(pm.Value)
   248  		}
   249  	}
   250  
   251  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsCurrentLogicalThreads) {
   252  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   253  			seen[name] = true
   254  			mx[netframeworkPrefix+name+"_clrlocksandthreads_current_logical_threads"] += int64(pm.Value)
   255  		}
   256  	}
   257  
   258  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsPhysicalThreadsCurrent) {
   259  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   260  			seen[name] = true
   261  			mx[netframeworkPrefix+name+"_clrlocksandthreads_physical_threads_current"] += int64(pm.Value)
   262  		}
   263  	}
   264  
   265  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsRecognizedThreadsTotal) {
   266  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   267  			seen[name] = true
   268  			mx[netframeworkPrefix+name+"_clrlocksandthreads_recognized_threads_total"] += int64(pm.Value)
   269  		}
   270  	}
   271  
   272  	for _, pm := range pms.FindByName(metricNetFrameworkCLRLocksAndThreadsContentionsTotal) {
   273  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   274  			seen[name] = true
   275  			mx[netframeworkPrefix+name+"_clrlocksandthreads_contentions_total"] += int64(pm.Value)
   276  		}
   277  	}
   278  
   279  	for proc := range seen {
   280  		if !w.cache.netFrameworkCLRLocksThreads[proc] {
   281  			w.cache.netFrameworkCLRLocksThreads[proc] = true
   282  			w.addProcessNetFrameworkLocksAndThreadsCharts(proc)
   283  		}
   284  	}
   285  
   286  	for proc := range w.cache.netFrameworkCLRLocksThreads {
   287  		if !seen[proc] {
   288  			delete(w.cache.netFrameworkCLRLocksThreads, proc)
   289  			w.removeProcessNetFrameworkLocksAndThreadsCharts(proc)
   290  		}
   291  	}
   292  }
   293  
   294  const (
   295  	metricNetFrameworkCLRMemoryAllocatedBytesTotal   = "windows_netframework_clrmemory_allocated_bytes_total"
   296  	metricNetFrameworkCLRMemoryFinalizationSurvivors = "windows_netframework_clrmemory_finalization_survivors"
   297  	metricNetFrameworkCLRMemoryHeapSizeBytes         = "windows_netframework_clrmemory_heap_size_bytes"
   298  	metricNetFrameworkCLRMemoryPromotedBytes         = "windows_netframework_clrmemory_promoted_bytes"
   299  	metricNetFrameworkCLRMemoryNumberGCHandles       = "windows_netframework_clrmemory_number_gc_handles"
   300  	metricNetFrameworkCLRMemoryCollectionsTotal      = "windows_netframework_clrmemory_collections_total"
   301  	metricNetFrameworkCLRMemoryInducedGCTotal        = "windows_netframework_clrmemory_induced_gc_total"
   302  	metricNetFrameworkCLRMemoryNumberPinnedObjects   = "windows_netframework_clrmemory_number_pinned_objects"
   303  	metricNetFrameworkCLRMemoryNumberSinkBlockInUse  = "windows_netframework_clrmemory_number_sink_blocksinuse"
   304  	metricNetFrameworkCLRMemoryCommittedBytes        = "windows_netframework_clrmemory_committed_bytes"
   305  	metricNetFrameworkCLRMemoryReservedBytes         = "windows_netframework_clrmemory_reserved_bytes"
   306  	metricNetFrameworkCLRMemoryGCTimePercent         = "windows_netframework_clrmemory_gc_time_percent"
   307  )
   308  
   309  func (w *Windows) collectNetFrameworkCLRMemory(mx map[string]int64, pms prometheus.Series) {
   310  	seen := make(map[string]bool)
   311  
   312  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryAllocatedBytesTotal) {
   313  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   314  			seen[name] = true
   315  			mx[netframeworkPrefix+name+"_clrmemory_allocated_bytes_total"] += int64(pm.Value)
   316  		}
   317  	}
   318  
   319  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryFinalizationSurvivors) {
   320  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   321  			seen[name] = true
   322  			mx[netframeworkPrefix+name+"_clrmemory_finalization_survivors"] += int64(pm.Value)
   323  		}
   324  	}
   325  
   326  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryHeapSizeBytes) {
   327  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   328  			seen[name] = true
   329  			mx[netframeworkPrefix+name+"_clrmemory_heap_size_bytes"] += int64(pm.Value)
   330  		}
   331  	}
   332  
   333  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryPromotedBytes) {
   334  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   335  			seen[name] = true
   336  			mx[netframeworkPrefix+name+"_clrmemory_promoted_bytes"] += int64(pm.Value)
   337  		}
   338  	}
   339  
   340  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberGCHandles) {
   341  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   342  			seen[name] = true
   343  			mx[netframeworkPrefix+name+"_clrmemory_number_gc_handles"] += int64(pm.Value)
   344  		}
   345  	}
   346  
   347  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryCollectionsTotal) {
   348  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   349  			seen[name] = true
   350  			mx[netframeworkPrefix+name+"_clrmemory_collections_total"] += int64(pm.Value)
   351  		}
   352  	}
   353  
   354  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryInducedGCTotal) {
   355  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   356  			seen[name] = true
   357  			mx[netframeworkPrefix+name+"_clrmemory_induced_gc_total"] += int64(pm.Value)
   358  		}
   359  	}
   360  
   361  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberPinnedObjects) {
   362  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   363  			seen[name] = true
   364  			mx[netframeworkPrefix+name+"_clrmemory_number_pinned_objects"] += int64(pm.Value)
   365  		}
   366  	}
   367  
   368  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryNumberSinkBlockInUse) {
   369  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   370  			seen[name] = true
   371  			mx[netframeworkPrefix+name+"_clrmemory_number_sink_blocksinuse"] += int64(pm.Value)
   372  		}
   373  	}
   374  
   375  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryCommittedBytes) {
   376  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   377  			seen[name] = true
   378  			mx[netframeworkPrefix+name+"_clrmemory_committed_bytes"] += int64(pm.Value)
   379  		}
   380  	}
   381  
   382  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryReservedBytes) {
   383  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   384  			seen[name] = true
   385  			mx[netframeworkPrefix+name+"_clrmemory_reserved_bytes"] += int64(pm.Value)
   386  		}
   387  	}
   388  
   389  	for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryGCTimePercent) {
   390  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   391  			seen[name] = true
   392  			mx[netframeworkPrefix+name+"_clrmemory_gc_time_percent"] += int64(pm.Value)
   393  		}
   394  	}
   395  
   396  	for proc := range seen {
   397  		if !w.cache.netFrameworkCLRMemory[proc] {
   398  			w.cache.netFrameworkCLRMemory[proc] = true
   399  			w.addProcessNetFrameworkMemoryCharts(proc)
   400  		}
   401  	}
   402  
   403  	for proc := range w.cache.netFrameworkCLRMemory {
   404  		if !seen[proc] {
   405  			delete(w.cache.netFrameworkCLRMemory, proc)
   406  			w.removeProcessNetFrameworkMemoryCharts(proc)
   407  		}
   408  	}
   409  }
   410  
   411  const (
   412  	metricNetFrameworkCLRRemotingChannelsTotal             = "windows_netframework_clrremoting_channels_total"
   413  	metricNetFrameworkCLRRemotingContextBoundClassesLoaded = "windows_netframework_clrremoting_context_bound_classes_loaded"
   414  	metricNetFrameworkCLRRemotingContextBoundObjectsTotal  = "windows_netframework_clrremoting_context_bound_objects_total"
   415  	metricNetFrameworkCLRRemotingContextProxiesTotal       = "windows_netframework_clrremoting_context_proxies_total"
   416  	metricNetFrameworkCLRRemotingContexts                  = "windows_netframework_clrremoting_contexts"
   417  	metricNetFrameworkCLRRemotingRemoteCallsTotal          = "windows_netframework_clrremoting_remote_calls_total"
   418  )
   419  
   420  func (w *Windows) collectNetFrameworkCLRRemoting(mx map[string]int64, pms prometheus.Series) {
   421  	seen := make(map[string]bool)
   422  
   423  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingChannelsTotal) {
   424  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   425  			seen[name] = true
   426  			mx[netframeworkPrefix+name+"_clrremoting_channels_total"] += int64(pm.Value)
   427  		}
   428  	}
   429  
   430  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextBoundClassesLoaded) {
   431  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   432  			seen[name] = true
   433  			mx[netframeworkPrefix+name+"_clrremoting_context_bound_classes_loaded"] += int64(pm.Value)
   434  		}
   435  	}
   436  
   437  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextBoundObjectsTotal) {
   438  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   439  			seen[name] = true
   440  			mx[netframeworkPrefix+name+"_clrremoting_context_bound_objects_total"] += int64(pm.Value)
   441  		}
   442  	}
   443  
   444  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContextProxiesTotal) {
   445  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   446  			seen[name] = true
   447  			mx[netframeworkPrefix+name+"_clrremoting_context_proxies_total"] += int64(pm.Value)
   448  		}
   449  	}
   450  
   451  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingContexts) {
   452  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   453  			seen[name] = true
   454  			mx[netframeworkPrefix+name+"_clrremoting_contexts"] += int64(pm.Value)
   455  		}
   456  	}
   457  
   458  	for _, pm := range pms.FindByName(metricNetFrameworkCLRRemotingRemoteCallsTotal) {
   459  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   460  			seen[name] = true
   461  			mx[netframeworkPrefix+name+"_clrremoting_remote_calls_total"] += int64(pm.Value)
   462  		}
   463  	}
   464  
   465  	for proc := range seen {
   466  		if !w.cache.netFrameworkCLRRemoting[proc] {
   467  			w.cache.netFrameworkCLRRemoting[proc] = true
   468  			w.addProcessNetFrameworkRemotingCharts(proc)
   469  		}
   470  	}
   471  
   472  	for proc := range w.cache.netFrameworkCLRRemoting {
   473  		if !seen[proc] {
   474  			delete(w.cache.netFrameworkCLRRemoting, proc)
   475  			w.removeProcessNetFrameworkRemotingCharts(proc)
   476  		}
   477  	}
   478  }
   479  
   480  const (
   481  	metricNetFrameworkCLRSecurityLinkTimeChecksTotal = "windows_netframework_clrsecurity_link_time_checks_total"
   482  	metricNetFrameworkCLRSecurityRTChecksTimePercent = "windows_netframework_clrsecurity_rt_checks_time_percent"
   483  	metricNetFrameworkCLRSecurityStackWalkDepth      = "windows_netframework_clrsecurity_stack_walk_depth"
   484  	metricNetFrameworkCLRSecurityRuntimeChecksTotal  = "windows_netframework_clrsecurity_runtime_checks_total"
   485  )
   486  
   487  func (w *Windows) collectNetFrameworkCLRSecurity(mx map[string]int64, pms prometheus.Series) {
   488  	seen := make(map[string]bool)
   489  
   490  	for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityLinkTimeChecksTotal) {
   491  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   492  			seen[name] = true
   493  			mx[netframeworkPrefix+name+"_clrsecurity_link_time_checks_total"] += int64(pm.Value)
   494  		}
   495  	}
   496  
   497  	for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityRTChecksTimePercent) {
   498  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   499  			seen[name] = true
   500  			mx[netframeworkPrefix+name+"_clrsecurity_checks_time_percent"] += int64(pm.Value)
   501  		}
   502  	}
   503  
   504  	for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityStackWalkDepth) {
   505  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   506  			seen[name] = true
   507  			mx[netframeworkPrefix+name+"_clrsecurity_stack_walk_depth"] += int64(pm.Value)
   508  		}
   509  	}
   510  
   511  	for _, pm := range pms.FindByName(metricNetFrameworkCLRSecurityRuntimeChecksTotal) {
   512  		if name := cleanProcessName(pm.Labels.Get("process")); name != "" {
   513  			seen[name] = true
   514  			mx[netframeworkPrefix+name+"_clrsecurity_runtime_checks_total"] += int64(pm.Value)
   515  		}
   516  	}
   517  
   518  	for proc := range seen {
   519  		if !w.cache.netFrameworkCLRSecurity[proc] {
   520  			w.cache.netFrameworkCLRSecurity[proc] = true
   521  			w.addProcessNetFrameworkSecurityCharts(proc)
   522  		}
   523  	}
   524  
   525  	for proc := range w.cache.netFrameworkCLRSecurity {
   526  		if !seen[proc] {
   527  			delete(w.cache.netFrameworkCLRSecurity, proc)
   528  			w.removeProcessNetFrameworkSecurityCharts(proc)
   529  		}
   530  	}
   531  }