diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/python.d.plugin/cpuidle/cpuidle.chart.py | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-a64a253794ac64cb40befee54db53bde17dd0d49.tar.xz netdata-a64a253794ac64cb40befee54db53bde17dd0d49.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 - |