Exemplo n.º 1
0
Arquivo: views.py Projeto: ymc/hue
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
Exemplo n.º 2
0
Arquivo: views.py Projeto: ymc/hue
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
  })