How to use the statistics.TopRecorder function in statistics

To help you get started, we’ve selected a few statistics 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 slideinc / gogreen / gogreen / corohttpd.py View on Github external
self._exit = False
        self._headers = [HOST_HEADER]
        self._encblack = None
        self._graceperiod = 0
        self._send_size = SEND_BUF_SIZE
        self._recv_size = RECV_BUF_SIZE
        self._connects = 0
        self._requests = 0
        self._response = 0
        self._recorder = statistics.Recorder()
        self._stoptime = 30

        self._wall_time = statistics.TopRecorder(threshold = 0.0)
        self._exec_time = statistics.TopRecorder(threshold = 0.0)
        self._nyld_time = statistics.TopRecorder(threshold = 0.0)
        self._resu_time = statistics.TopRecorder(threshold = 0)
        #
        # mark whether socket was provided to ensure creator is always
        # the destructor as well.
        #
        self.socket = kwargs.get('socket', None)
        self.passed = bool(self.socket is not None)
        self._tbrec = kwargs.get('tbrec', None)
        self._debug = False
        #
        # post request callbacks.
        #
        preq = kwargs.get('postreq', [])
        preq = (isinstance(preq, (list, tuple)) and [preq] or [[preq]])[0]

        self._postreqs = preq
github slideinc / gogreen / gogreen / corowork.py View on Github external
self.identity = kwargs.get('identity', {})
        self.waiter   = coro.coroutine_cond()
        self.requests = []

        for size in self.sizes:
            self.requests.append(coro.coroutine_fifo())
            self.workers.append([])

        self.stats  = statistics.Recorder()
        self.wqsize = statistics.WQSizeRecorder()
        self.dbuse  = statistics.Recorder()

        self.wlimit = statistics.TopRecorder(threshold = 0.0)
        self.elimit = statistics.TopRecorder(threshold = 0.0)
        self.tlimit = statistics.TopRecorder(threshold = 0.0)
        self.rlimit = statistics.TopRecorder(threshold = 0)

        self.kwargs.update({
            'filter':   self.filter})
github slideinc / gogreen / gogreen / corohttpd.py View on Github external
self._max_requests = 0
        self._outstanding_requests = {}
        self._exit = False
        self._headers = [HOST_HEADER]
        self._encblack = None
        self._graceperiod = 0
        self._send_size = SEND_BUF_SIZE
        self._recv_size = RECV_BUF_SIZE
        self._connects = 0
        self._requests = 0
        self._response = 0
        self._recorder = statistics.Recorder()
        self._stoptime = 30

        self._wall_time = statistics.TopRecorder(threshold = 0.0)
        self._exec_time = statistics.TopRecorder(threshold = 0.0)
        self._nyld_time = statistics.TopRecorder(threshold = 0.0)
        self._resu_time = statistics.TopRecorder(threshold = 0)
        #
        # mark whether socket was provided to ensure creator is always
        # the destructor as well.
        #
        self.socket = kwargs.get('socket', None)
        self.passed = bool(self.socket is not None)
        self._tbrec = kwargs.get('tbrec', None)
        self._debug = False
        #
        # post request callbacks.
        #
        preq = kwargs.get('postreq', [])
        preq = (isinstance(preq, (list, tuple)) and [preq] or [[preq]])[0]
github slideinc / gogreen / gogreen / corowork.py View on Github external
self.identity = kwargs.get('identity', {})
        self.waiter   = coro.coroutine_cond()
        self.requests = []

        for size in self.sizes:
            self.requests.append(coro.coroutine_fifo())
            self.workers.append([])

        self.stats  = statistics.Recorder()
        self.wqsize = statistics.WQSizeRecorder()
        self.dbuse  = statistics.Recorder()

        self.wlimit = statistics.TopRecorder(threshold = 0.0)
        self.elimit = statistics.TopRecorder(threshold = 0.0)
        self.tlimit = statistics.TopRecorder(threshold = 0.0)
        self.rlimit = statistics.TopRecorder(threshold = 0)

        self.kwargs.update({
            'filter':   self.filter})
github slideinc / gogreen / gogreen / corowork.py View on Github external
self.workers = []

        self.identity = kwargs.get('identity', {})
        self.waiter   = coro.coroutine_cond()
        self.requests = []

        for size in self.sizes:
            self.requests.append(coro.coroutine_fifo())
            self.workers.append([])

        self.stats  = statistics.Recorder()
        self.wqsize = statistics.WQSizeRecorder()
        self.dbuse  = statistics.Recorder()

        self.wlimit = statistics.TopRecorder(threshold = 0.0)
        self.elimit = statistics.TopRecorder(threshold = 0.0)
        self.tlimit = statistics.TopRecorder(threshold = 0.0)
        self.rlimit = statistics.TopRecorder(threshold = 0)

        self.kwargs.update({
            'filter':   self.filter})
github slideinc / gogreen / gogreen / corowork.py View on Github external
self.klist   = []
        self.workers = []

        self.identity = kwargs.get('identity', {})
        self.waiter   = coro.coroutine_cond()
        self.requests = []

        for size in self.sizes:
            self.requests.append(coro.coroutine_fifo())
            self.workers.append([])

        self.stats  = statistics.Recorder()
        self.wqsize = statistics.WQSizeRecorder()
        self.dbuse  = statistics.Recorder()

        self.wlimit = statistics.TopRecorder(threshold = 0.0)
        self.elimit = statistics.TopRecorder(threshold = 0.0)
        self.tlimit = statistics.TopRecorder(threshold = 0.0)
        self.rlimit = statistics.TopRecorder(threshold = 0)

        self.kwargs.update({
            'filter':   self.filter})
github slideinc / gogreen / gogreen / corohttpd.py View on Github external
self._outstanding_requests = {}
        self._exit = False
        self._headers = [HOST_HEADER]
        self._encblack = None
        self._graceperiod = 0
        self._send_size = SEND_BUF_SIZE
        self._recv_size = RECV_BUF_SIZE
        self._connects = 0
        self._requests = 0
        self._response = 0
        self._recorder = statistics.Recorder()
        self._stoptime = 30

        self._wall_time = statistics.TopRecorder(threshold = 0.0)
        self._exec_time = statistics.TopRecorder(threshold = 0.0)
        self._nyld_time = statistics.TopRecorder(threshold = 0.0)
        self._resu_time = statistics.TopRecorder(threshold = 0)
        #
        # mark whether socket was provided to ensure creator is always
        # the destructor as well.
        #
        self.socket = kwargs.get('socket', None)
        self.passed = bool(self.socket is not None)
        self._tbrec = kwargs.get('tbrec', None)
        self._debug = False
        #
        # post request callbacks.
        #
        preq = kwargs.get('postreq', [])
        preq = (isinstance(preq, (list, tuple)) and [preq] or [[preq]])[0]

        self._postreqs = preq
github slideinc / gogreen / gogreen / corohttpd.py View on Github external
self._handlers = []
        self._max_requests = 0
        self._outstanding_requests = {}
        self._exit = False
        self._headers = [HOST_HEADER]
        self._encblack = None
        self._graceperiod = 0
        self._send_size = SEND_BUF_SIZE
        self._recv_size = RECV_BUF_SIZE
        self._connects = 0
        self._requests = 0
        self._response = 0
        self._recorder = statistics.Recorder()
        self._stoptime = 30

        self._wall_time = statistics.TopRecorder(threshold = 0.0)
        self._exec_time = statistics.TopRecorder(threshold = 0.0)
        self._nyld_time = statistics.TopRecorder(threshold = 0.0)
        self._resu_time = statistics.TopRecorder(threshold = 0)
        #
        # mark whether socket was provided to ensure creator is always
        # the destructor as well.
        #
        self.socket = kwargs.get('socket', None)
        self.passed = bool(self.socket is not None)
        self._tbrec = kwargs.get('tbrec', None)
        self._debug = False
        #
        # post request callbacks.
        #
        preq = kwargs.get('postreq', [])
        preq = (isinstance(preq, (list, tuple)) and [preq] or [[preq]])[0]