def _api_debug(self, stream, request, query): response = Message() debuginfo = {} NOTIFIER.snap(debuginfo) POLLER.snap(debuginfo) debuginfo["queue_history"] = QUEUE_HISTORY debuginfo["WWW"] = WWW stringio = StringIO.StringIO() pprint.pprint(debuginfo, stringio) stringio.seek(0) response.compose(code="200", reason="Ok", body=stringio, mimetype="text/plain") stream.send_response(request, response)
def _api_debug(stream, request, query): ''' Implements /api/debug URI ''' response = Message() debuginfo = {} NOTIFIER.snap(debuginfo) POLLER.snap(debuginfo) debuginfo["queue_history"] = QUEUE_HISTORY debuginfo["WWWDIR"] = utils_hier.WWWDIR gc.collect() debuginfo['typestats'] = objgraph.typestats() body = pprint.pformat(debuginfo) response.compose(code="200", reason="Ok", body=body, mimetype="text/plain") stream.send_response(request, response)