import uwsgi
import time
import sys
import os
def application(env, start_response):
print env
start_response('200 OK', [('Content-Type', 'text/html')])
yield '
uWSGI %s status
' % uwsgi.version
yield 'masterpid: ' + str(uwsgi.masterpid()) + '
'
yield 'started on: ' + time.ctime(uwsgi.started_on) + '
'
yield 'buffer size: ' + str(uwsgi.buffer_size) + '
'
yield 'total_requests: ' + str(uwsgi.total_requests()) + '
'
yield 'log size: ' + str(uwsgi.logsize()) + '
'
yield 'workers: ' + str(uwsgi.numproc) + '
'
yield "cwd: %s
" % os.getcwd()
try:
yield "mode: %s
" % uwsgi.mode
except Exception:
pass
try:
yield "pidfile: %s
" % uwsgi.pidfile
except Exception:
pass
yield "Hooks
"
for h in range(0, 255):
if uwsgi.has_hook(h):
yield "%d
" % h
yield 'dynamic options
'
yield ''
yield 'worker id | pid | in request | requests | running time | address space | rss | '
workers = uwsgi.workers()
yield 'workers
'
for w in workers:
# print w
# print w['running_time']
if w is not None:
yield '' + str(w['id']) + ' | ' + str(w['pid']) + ' | ' + str(w['pid']) + ' | ' + str(w['requests']) + ' | ' + str(w['running_time']) + ' | ' + str(w['vsz']) + ' | ' + str(w['rss']) + ' |
'
print w
yield '
'
yield "PYTHONPATH
"
yield ""
for p in sys.path:
yield "- %s
" % p
yield "
"
yield "%s" % str(os.uname())