Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3299 from matrix-org/matthew/macos-fixes
Browse files Browse the repository at this point in the history
disable CPUMetrics if no /proc/self/stat
  • Loading branch information
hawkowl authored May 29, 2018
2 parents adb6bac + ff1bc0a commit 235b532
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
all_collectors = []
all_gauges = {}

HAVE_PROC_SELF_STAT = os.path.exists("/proc/self/stat")


class RegistryProxy(object):

Expand Down Expand Up @@ -99,6 +101,8 @@ def __init__(self):
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()
Expand Down

0 comments on commit 235b532

Please sign in to comment.