def _cpu ( self ) : value = int ( psutil . cpu_percent ( ) ) set_metric ( "cpu" , value , category = self . category ) gauge ( "cpu" , value )
how to restrict cpu usage percent for python
Record CPU usage .
def _cpu(self):
        """Record CPU usage."""
        value = int(psutil.cpu_percent())
        set_metric("cpu", value, category=self.category)
        gauge("cpu", value)