mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
disable CPUMetrics if no /proc/self/stat
fixes build on macOS again
This commit is contained in:
parent
284e36ad04
commit
0a240ad36e
@ -34,6 +34,7 @@ all_metrics = []
|
|||||||
all_collectors = []
|
all_collectors = []
|
||||||
all_gauges = {}
|
all_gauges = {}
|
||||||
|
|
||||||
|
HAVE_PROC_SELF_STAT = os.path.exists("/proc/self/stat")
|
||||||
|
|
||||||
class RegistryProxy(object):
|
class RegistryProxy(object):
|
||||||
|
|
||||||
@ -99,6 +100,8 @@ class CPUMetrics(object):
|
|||||||
self.ticks_per_sec = ticks_per_sec
|
self.ticks_per_sec = ticks_per_sec
|
||||||
|
|
||||||
def collect(self):
|
def collect(self):
|
||||||
|
if not HAVE_PROC_SELF_STAT:
|
||||||
|
return
|
||||||
|
|
||||||
with open("/proc/self/stat") as s:
|
with open("/proc/self/stat") as s:
|
||||||
line = s.read()
|
line = s.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user