Skip to content
Snippets Groups Projects
Commit 0a240ad3 authored by Matthew Hodgson's avatar Matthew Hodgson
Browse files

disable CPUMetrics if no /proc/self/stat

fixes build on macOS again
parent 284e36ad
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@ all_metrics = []
all_collectors = []
all_gauges = {}
HAVE_PROC_SELF_STAT = os.path.exists("/proc/self/stat")
class RegistryProxy(object):
......@@ -99,6 +100,8 @@ class CPUMetrics(object):
self.ticks_per_sec = ticks_per_sec
def collect(self):
if not HAVE_PROC_SELF_STAT:
return
with open("/proc/self/stat") as s:
line = s.read()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment