(self, _)
Fetch WMI metrics.
Fetch WMI metrics.
Fetch WMI metrics .
def check(self, _):
        # type: (Any) -> None
        """
        Fetch WMI metrics.
        """
        # Create or retrieve an existing WMISampler
        metric_name_and_type_by_property, properties = self.get_wmi_properties()

        wmi_sampler = self.get_running_wmi_sampler(properties, self.filters, tag_by=self.tag_by)

        # Sample, extract & submit metrics
        try:
            wmi_sampler.sample()
            extracted_metrics = self.extract_metrics(wmi_sampler)
        except TimeoutException:
            self.log.warning(
                "WMI query timed out. class=%s - properties=%s - filters=%s - tag_queries=%s",
                self.wmi_class,
                properties,
                self.filters,
                self.tag_queries,
            )
        else:
            self._submit_metrics(extracted_metrics, metric_name_and_type_by_property)
def check ( self , _ ) : # type: (Any) -> None # Create or retrieve an existing WMISampler metric_name_and_type_by_property , properties = self . get_wmi_properties ( ) wmi_sampler = self . get_running_wmi_sampler ( properties , self . filters , tag_by = self . tag_by ) # Sample, extract & submit metrics try : wmi_sampler . sample ( ) extracted_metrics = self . extract_metrics ( wmi_sampler ) except TimeoutException : self . log . warning ( "WMI query timed out. class=%s - properties=%s - filters=%s - tag_queries=%s" , self . wmi_class , properties , self . filters , self . tag_queries , ) else : self . _submit_metrics ( extracted_metrics , metric_name_and_type_by_property )