def run(self): # noinspection PyBroadException try: while not self.stop: self.metrics_store.put_value_node_level(node_name=self.node.node_name, name="cpu_utilization_1s", value=sysstats.cpu_utilization(self.process), unit="%") except BaseException: logger.exception("Could not determine CPU utilization")
def record(self): import psutil try: self.metrics_store.put_value_node_level( node_name=self.node.node_name, name="cpu_utilization_1s", value=sysstats.cpu_utilization(self.process), unit="%") # this can happen when the Elasticsearch process has been terminated already and we were not quick enough to stop. except psutil.NoSuchProcess: pass
def run(self): self.disk_start = sysstats.disk_io_counters(self.disk_name) self.process_start = sysstats.process_io_counters(self.process) if self.process_start: logger.info("Using more accurate process-based I/O counters.") else: logger.warn("Process I/O counters are unsupported on this platform. Falling back to less accurate disk I/O counters.") while not self.stop: self.metrics_store.put_value_node_level(self.node.node_name, "cpu_utilization_1s_%s" % self.phase.name, sysstats.cpu_utilization(self.process), "%")
def run(self): import psutil # noinspection PyBroadException try: while not self.stop: self.metrics_store.put_value_node_level(node_name=self.node.node_name, name="cpu_utilization_1s", value=sysstats.cpu_utilization(self.process), unit="%") # this can happen when the Elasticsearch process has been terminated already and we were not quick enough to stop. except psutil.NoSuchProcess: pass except BaseException: logger.exception("Could not determine CPU utilization")
def run(self): self.disk_start = sysstats.disk_io_counters() self.process_start = sysstats.process_io_counters(self.process) if self.process_start: logger.info("Using more accurate process-based I/O counters.") else: logger.warn( "Process I/O counters are unsupported on this platform. Falling back to less accurate disk I/O counters." ) while not self.stop: self.metrics_store.put_value_node_level( self.node.node_name, "cpu_utilization_1s_%s" % self.phase.name, sysstats.cpu_utilization(self.process), "%")