Last active
March 26, 2019 20:19
-
-
Save jaraco/b67d91b555768bbd7c4001bdc978ce6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import cherrypy.lib.cpstats | |
class CherootStatistics(cherrypy.process.plugins.SimplePlugin): | |
def main(self): | |
self.bus.log('Enabling Cheroot statistics') | |
keys = ( | |
key | |
for key in logging.statistics.keys() | |
if 'Cheroot HTTPServer' in key | |
) | |
logging.statistics[next(keys)]['Enabled'] = True | |
def main(): | |
CherootStatistics(cherrypy.engine).subscribe() | |
config = { | |
'global': { | |
'server.socket_host': '::0', | |
}, | |
} | |
cherrypy.quickstart(cherrypy.lib.cpstats.StatsPage(), config=config) | |
__name__ == '__main__' and main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment