MCPcopy
hub / github.com/benoitc/gunicorn / memory_usage

Method memory_usage

examples/when_ready.conf.py:21–27  ·  view source on GitHub ↗
(self, pid)

Source from the content-addressed store, hash-verified

19 self.timeout = server.timeout / 2
20
21 def memory_usage(self, pid):
22 try:
23 out = commands.getoutput("ps -o rss -p %s" % pid)
24 except OSError:
25 return -1
26 used_mem = sum(int(x) for x in out.split('\n')[1:])
27 return used_mem
28
29 def run(self):
30 while True:

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected