def __init__()

in zktraffic/endpoints/stats_server.py [0:0]


  def __init__(self,
               iface,
               zkport,
               aggregation_depth,
               max_results=EndpointsServer.MAX_RESULTS,
               max_reqs=400000,
               max_reps=400000,
               max_events=400000,
               start_sniffer=True,
               timer=None,
               sampling=1.0,
               include_bytes=True):

    # Forcing a load of the multiprocessing module here
    # seem to be hitting http://bugs.python.org/issue8200
    multiprocessing.current_process().name

    self._max_results = max_results

    self._stats = QueueStatsLoader(max_reqs, max_reps, max_events, timer)

    self._stats.register_accumulator(
      'per_path', PerPathStatsAccumulator(aggregation_depth, include_bytes))
    self._stats.register_accumulator(
      'per_ip', PerIPStatsAccumulator(aggregation_depth, include_bytes))
    self._stats.register_accumulator(
      'per_auth', PerAuthStatsAccumulator(aggregation_depth, include_bytes))

    self._stats.start()

    super(StatsServer, self).__init__(
      iface,
      zkport,
      self._stats.handle_request,
      self._stats.handle_reply,
      self._stats.handle_event,
      start_sniffer,
      sampling=sampling)