parameters: (self)
return_statement: return groups
docstring: Group the counters by the suffix of their name.
  
      Since the same code-level counter (for instance "X") can result in
      several variables in the binary counters file that differ only by a
      two-character prefix (for instance "c:X" and "t:X") counters are
      grouped by suffix and then displayed with custom formatting
      depending on their prefix.
  
      Returns:
        A mapping from suffixes to a list of counters with that suffix,
        sorted by prefix.
docstring_summary: Group the counters by the suffix of their name.
docstring_tokens: Group the counters by the suffix of their name .
function: def ComputeCounters(self):
      """Group the counters by the suffix of their name.
  
      Since the same code-level counter (for instance "X") can result in
      several variables in the binary counters file that differ only by a
      two-character prefix (for instance "c:X" and "t:X") counters are
      grouped by suffix and then displayed with custom formatting
      depending on their prefix.
  
      Returns:
        A mapping from suffixes to a list of counters with that suffix,
        sorted by prefix.
      """
      names = {}
      for i in xrange(self.data.CountersInUse()):
        counter = self.data.Counter(i)
        name = counter.Name()
        names[name] = counter
  
      # By sorting the keys we ensure that the prefixes always come in the
      # same order ("c:" before "t:") which looks more consistent in the
      # ui.
      sorted_keys = names.keys()
      sorted_keys.sort()
  
      # Group together the names whose suffix after a ':' are the same.
      groups = {}
      for name in sorted_keys:
        counter = names[name]
        if ":" in name:
          name = name[name.find(":")+1:]
        if not name in groups:
          groups[name] = []
        groups[name].append(counter)
  
      return groups
function_tokens: def ComputeCounters ( self ) : names = { } for i in xrange ( self . data . CountersInUse ( ) ) : counter = self . data . Counter ( i ) name = counter . Name ( ) names [ name ] = counter # By sorting the keys we ensure that the prefixes always come in the # same order ("c:" before "t:") which looks more consistent in the # ui. sorted_keys = names . keys ( ) sorted_keys . sort ( ) # Group together the names whose suffix after a ':' are the same. groups = { } for name in sorted_keys : counter = names [ name ] if ":" in name : name = name [ name . find ( ":" ) + 1 : ] if not name in groups : groups [ name ] = [ ] groups [ name ] . append ( counter ) return groups