summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/cpuidle/cpuidle.chart.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/cpuidle/cpuidle.chart.py (renamed from python.d/cpuidle.chart.py)8
1 files changed, 4 insertions, 4 deletions
diff --git a/python.d/cpuidle.chart.py b/collectors/python.d.plugin/cpuidle/cpuidle.chart.py
index d14c6aaf3..feac025bf 100644
--- a/python.d/cpuidle.chart.py
+++ b/collectors/python.d.plugin/cpuidle/cpuidle.chart.py
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
# Description: cpuidle netdata python.d module
# Author: Steven Noonan (tycho)
+# SPDX-License-Identifier: GPL-3.0-or-later
+import ctypes
import glob
import os
import platform
from bases.FrameworkServices.SimpleService import SimpleService
-import ctypes
syscall = ctypes.CDLL('libc.so.6').syscall
# default module values (can be overridden per job in `config`)
@@ -107,7 +108,7 @@ class Service(SimpleService):
def check(self):
if self.__gettid() is None:
- self.error("Cannot get thread ID. Stats would be completely broken.")
+ self.error('Cannot get thread ID. Stats would be completely broken.')
return False
for path in sorted(glob.glob(self.sys_dir + '/cpu*/cpuidle/state*/name')):
@@ -140,9 +141,8 @@ class Service(SimpleService):
# Sort order by kernel-specified CPU index
self.order.sort(key=lambda x: int(x.split('_')[0][3:]))
- if len(self.definitions) == 0:
+ if not self.definitions:
self.error("couldn't find cstate stats")
return False
return True
-