code: def statsHandler(serverName, path=''):
    
    path = path.lstrip('/')
    parts = path.split('/')
    if not parts[0]:
      parts = parts[1:]
    statDict = util.lookup(scales.getStats(), parts)
  
    if statDict is None:
      abort(404, 'No stats found with path /%s' % '/'.join(parts))
  
    output = StringIO()
    outputFormat = request.args.get('format', 'html')
    query = request.args.get('query', None)
    if outputFormat == 'json':
      formats.jsonFormat(output, statDict, query)
    elif outputFormat == 'prettyjson':
      formats.jsonFormat(output, statDict, query, pretty=True)
    else:
      formats.htmlHeader(output, '/' + path, serverName, query)
      formats.htmlFormat(output, tuple(parts), statDict, query)
  
    return output.getvalue()
docs: Renders a GET request, by showing this nodes stats and children.