parameters: (self)
return_statement: return statistics_data
docstring: Calculates an entire server's counts, and returns statistics
          data in a format to send out to the stats module, including each
          counter. If nothing is counted yet, then it returns an empty
          dictionary.
docstring_summary: Calculates an entire server's counts, and returns statistics
          data in a format to send out to the stats module, including each
          counter. If nothing is counted yet, then it returns an empty
          dictionary.
docstring_tokens: Calculates an entire server s counts and returns statistics data in a format to send out to the stats module including each counter . If nothing is counted yet then it returns an empty dictionary .
function: def get_statistics(self):
          """Calculates an entire server's counts, and returns statistics
          data in a format to send out to the stats module, including each
          counter. If nothing is counted yet, then it returns an empty
          dictionary."""
          # entire copy
          statistics_data = self._statistics_data.copy()
          # If there is no 'zones' found in statistics_data,
          # i.e. statistics_data contains no per-zone counter, it just
          # returns statistics_data because calculating total counts
          # across the zone names isn't necessary.
          if self._perzone_prefix not in statistics_data:
              return statistics_data
          zones = statistics_data[self._perzone_prefix]
          # Start calculation for '_SERVER_' counts
          zones_spec = bundy.config.find_spec_part(self._statistics_spec,
                                                 self._perzone_prefix)
          zones_data = {}
          for cls in zones.keys():
              for zone in zones[cls].keys():
                  for (attr, val) in zones[cls][zone].items():
                      id_str1 = '%s/%s/%s' % (cls, zone, attr)
                      id_str2 = '%s/%s/%s' % (cls, self._entire_server, attr)
                      counters._set_counter(zones_data, zones_spec, id_str1, val)
                      counters._inc_counter(zones_data, zones_spec, id_str2, val)
          # insert entire-server counts
          statistics_data[self._perzone_prefix] = dict(
              statistics_data[self._perzone_prefix],
              **zones_data)
          return statistics_data
function_tokens: def get_statistics ( self ) : # entire copy statistics_data = self . _statistics_data . copy ( ) # If there is no 'zones' found in statistics_data, # i.e. statistics_data contains no per-zone counter, it just # returns statistics_data because calculating total counts # across the zone names isn't necessary. if self . _perzone_prefix not in statistics_data : return statistics_data zones = statistics_data [ self . _perzone_prefix ] # Start calculation for '_SERVER_' counts zones_spec = bundy . config . find_spec_part ( self . _statistics_spec , self . _perzone_prefix ) zones_data = { } for cls in zones . keys ( ) : for zone in zones [ cls ] . keys ( ) : for ( attr , val ) in zones [ cls ] [ zone ] . items ( ) : id_str1 = '%s/%s/%s' % ( cls , zone , attr ) id_str2 = '%s/%s/%s' % ( cls , self . _entire_server , attr ) counters . _set_counter ( zones_data , zones_spec , id_str1 , val ) counters . _inc_counter ( zones_data , zones_spec , id_str2 , val ) # insert entire-server counts statistics_data [ self . _perzone_prefix ] = dict ( statistics_data [ self . _perzone_prefix ] , * * zones_data ) return statistics_data