How to use the perfmetrics.metricmethod function in perfmetrics

To help you get started, we’ve selected a few perfmetrics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pypa / pypi-legacy / rpc.py View on Github external
    @dogstatsd.timed('xmlrpc.call')
    @metricmethod
    def __call__(self, webui_obj):
        webui_obj.handler.send_response(200, 'OK')
        webui_obj.handler.send_header('Content-type', 'text/xml')
        webui_obj.handler.send_header('charset', 'UTF-8' )
        webui_obj.handler.end_headers()
        try:
            length = int(webui_obj.env['CONTENT_LENGTH'])
            assert length < 10*1024*1024, 'request content way too big'
            data = webui_obj.handler.rfile.read(length)
            # This should be thread-safe, as the store is really a singleton
            self.store = webui_obj.store
        except Exception, e:
            # report as a fault to caller rather than propogating up to generic
            # exception handler
            response = xmlrpclib.dumps(
                xmlrpclib.Fault(1, repr(e)),
github pypa / pypi-legacy / rpc.py View on Github external
    @dogstatsd.timed('xmlrpc.dispatch')
    @metricmethod
    def _dispatch(self, method, params):
        if not method.startswith('system.'):
            # Add store to all of our own methods
            params = (self.store,)+tuple(params)
        return SimpleXMLRPCDispatcher._dispatch(self, method, params)
github pypa / pypi-legacy / rpc.py View on Github external
    @dogstatsd.timed('xmlrpc.multicall')
    @metricmethod
    def system_multicall(self, call_list):
        if len(call_list) > 100:
            raise Fault, "multicall too large"
        return SimpleXMLRPCDispatcher.system_multicall(self, call_list)

perfmetrics

Send performance metrics about Python code to Statsd

BSD-2-Clause
Latest version published 5 months ago

Package Health Score

59 / 100
Full package analysis

Similar packages