Exemplo n.º 1
0
def index(request):
  # show all business
  businesses = Business.objects.all()
  params = {
    'businesses': businesses,
  }
  return respond(request, 'business/index.html', params)
Exemplo n.º 2
0
def index(request):
    # show all cluster
    longhauls = Longhaul.objects.all()
    params = {
        'longhauls': longhauls,
    }
    return respond(request, 'hbase/index.html', params)
Exemplo n.º 3
0
def index(request):
    # show all business
    businesses = Business.objects.all()
    params = {
        'businesses': businesses,
    }
    return respond(request, 'business/index.html', params)
Exemplo n.º 4
0
def index(request):
  # show all cluster
  longhauls = Longhaul.objects.all()
  params = {
    'longhauls': longhauls,
  }
  return respond(request, 'hbase/index.html', params)
Exemplo n.º 5
0
def index(request, addrs, path=""):
    path = "/" + path
    try:
        parent_path = os.path.dirname(path)
        znode = ZNode(addrs, path)
        znode.children.sort()
        if not istext(znode.data):
            znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data])
            znode.datatype = "bin"
        else:
            znode.datatype = "str"

        params = {'znode': znode, 'addrs': addrs, 'parent_path': parent_path}
        return respond(request, 'zktree/index.html', params)
    except Exception as err:
        return respond(request, 'zktree/error.html', {'error': str(err)})
Exemplo n.º 6
0
def index(request, addrs, path=""):
    path = "/" + path
    try:
        parent_path = os.path.dirname(path)
        znode = ZNode(addrs, path)
        znode.children.sort()
        if not istext(znode.data):
            znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data])
            znode.datatype = "bin"
        else:
            znode.datatype = "str"

        params = {'znode':znode,
                  'addrs':addrs,
                  'parent_path':parent_path}
        return respond(request, 'zktree/index.html', params)
    except Exception as err:
        return respond(request, 'zktree/error.html',
                       {'error':str(err)})
Exemplo n.º 7
0
def show_online(request, id, access_type, label):
  business = Business.objects.get(id=id)
  metrics = get_online_counters(access_type, label)

  params = {
    'business_id' : id,
    'write_menus' : ONLINE_METRICS_MENU_CONFIG['Online Write'],
    'read_menus' : ONLINE_METRICS_MENU_CONFIG['Online Read'],
    'metrics' : metrics,
    'business': business,
  }
  return respond(request, 'business/online.html', params)
Exemplo n.º 8
0
def show_online(request, id, access_type, label):
    business = Business.objects.get(id=id)
    metrics = get_online_counters(access_type, label)

    params = {
        'business_id': id,
        'write_menus': ONLINE_METRICS_MENU_CONFIG['Online Write'],
        'read_menus': ONLINE_METRICS_MENU_CONFIG['Online Read'],
        'metrics': metrics,
        'business': business,
    }
    return respond(request, 'business/online.html', params)
Exemplo n.º 9
0
def show_longhaul(request, id):
    longhaul = Longhaul.objects.get(id=id)
    group = longhaul.getCounterGroup()
    counters = get_counters_by_group(group)
    endpoint = 'unknown'
    counter_names = []
    for counter in counters:
        endpoint = counter.host
        counter_names.append(group + '-' + counter.name)

    params = {
        'endpoint': endpoint,
        'counter_names': counter_names,
        'longhaul': longhaul,
    }
    return respond(request, 'hbase/longhaul.html', params)
Exemplo n.º 10
0
def show_longhaul(request, id):
  longhaul = Longhaul.objects.get(id=id)
  group = longhaul.getCounterGroup()
  counters = get_counters_by_group(group)
  endpoint = 'unknown'
  counter_names = []
  for counter in counters:
    endpoint = counter.host
    counter_names.append(group + '-' + counter.name)
  
  params = {
    'endpoint': endpoint,
    'counter_names': counter_names,
    'longhaul': longhaul,
  }
  return respond(request, 'hbase/longhaul.html', params)
Exemplo n.º 11
0
def show_business(request, id, access_type, label):
  business = Business.objects.get(id=id)
  group = business.getCounterGroup()
  endpoint = get_endpoint(group, access_type)
  metric_names = []
  if label == HBASE_OPERATION_LABEL:
    metric_names = get_counter_name_of_hbase_operation(group, access_type)
  else:
    metric_names = get_counter_name(group, access_type, label)

  params = {
    'business_id' : id,
    'endpoint': endpoint,
    'write_menus' : BUSINESS_METRICS_VIEW_CONFIG['Write HBase'],
    'read_menus' : BUSINESS_METRICS_VIEW_CONFIG['Read HBase'],
    'metric_names' : metric_names,
    'business': business,
  }
  return respond(request, 'business/business.html', params)
Exemplo n.º 12
0
def show_business(request, id, access_type, label):
    business = Business.objects.get(id=id)
    group = business.getCounterGroup()
    endpoint = get_endpoint(group, access_type)
    metric_names = []
    if label == HBASE_OPERATION_LABEL:
        metric_names = get_counter_name_of_hbase_operation(group, access_type)
    else:
        metric_names = get_counter_name(group, access_type, label)

    params = {
        'business_id': id,
        'endpoint': endpoint,
        'write_menus': BUSINESS_METRICS_VIEW_CONFIG['Write HBase'],
        'read_menus': BUSINESS_METRICS_VIEW_CONFIG['Read HBase'],
        'metric_names': metric_names,
        'business': business,
    }
    return respond(request, 'business/business.html', params)