def _get_overview(host_ports): zstats = {} for host_port in host_ports.split(','): host, port = map(str.strip, host_port.split(':')) zks = stats.ZooKeeperStats(host, port) zstats[host_port] = zks.get_stats() or {} return zstats
def clients(request, id, host): cluster = get_cluster_or_404(id) parts = host.split(':') if len(parts) != 2: raise Http404 host, port = parts zks = stats.ZooKeeperStats(host, port) clients = zks.get_clients() return render('clients.mako', request, { 'clusters': CLUSTERS.get(), 'cluster': cluster, 'host': host, 'port': port, 'clients': clients })