Beispiel #1
0
def retrieve_data(context, path):
    """Retrieve json data from a couchbase server through REST calls"""
    # TODO: use cbtestlib
    server = Server(context.get("host", "127.0.0.1"))
    rest = RestConnection(server)
    api = rest.baseUrl + path

    try:
        status, content, header = rest._http_request(api)  # TODO: expose
    except ServerUnavailableException, e:
        logging.error("unable to retrieve data from %s: %s" % (server, e))
        return retrieve_meta(context, path)
Beispiel #2
0
def retrieve_data(context, path):
    """Retrieve json data from a couchbase server through REST calls"""
    # TODO: use cbtestlib
    server = Server(context.get("host", "127.0.0.1"))
    rest = RestConnection(server)
    api = rest.baseUrl + path

    try:
        status, content, header = rest._http_request(api)  #TODO: expose
    except ServerUnavailableException, e:
        logging.error("unable to retrieve data from %s: %s" % (server, e))
        return retrieve_meta(context, path)
Beispiel #3
0
    """Retrieve json data from a couchbase server through REST calls"""
    # TODO: use cbtestlib
    server = Server(context.get("host", "127.0.0.1"))
    rest = RestConnection(server)
    api = rest.baseUrl + path

    try:
        status, content, header = rest._http_request(api)  # TODO: expose
    except ServerUnavailableException, e:
        logging.error("unable to retrieve data from %s: %s" % (server, e))
        return retrieve_meta(context, path)

    if status:
        return json.loads(content)

    return retrieve_meta(context, path)


def collect_mc_stats(root, parents, data, meta, coll, key, val, meta_val, meta_inf, level=0):
    """
    Collect memcached stats
    Dump time series data a json snapshot
    """
    if not isinstance(val, list):
        logging.error("unable to collect mc stats: val must be a list - %s" % val)
        return False

    try:
        stats, meta = mc_stats.get(block=False)
        show_all_stats(stats, meta)
    except Queue.Empty:
Beispiel #4
0
    """Retrieve json data from a couchbase server through REST calls"""
    # TODO: use cbtestlib
    server = Server(context.get("host", "127.0.0.1"))
    rest = RestConnection(server)
    api = rest.baseUrl + path

    try:
        status, content, header = rest._http_request(api)  #TODO: expose
    except ServerUnavailableException, e:
        logging.error("unable to retrieve data from %s: %s" % (server, e))
        return retrieve_meta(context, path)

    if status:
        return json.loads(content)

    return retrieve_meta(context, path)


def collect_mc_stats(root,
                     parents,
                     data,
                     meta,
                     coll,
                     key,
                     val,
                     meta_val,
                     meta_inf,
                     level=0):
    """
    Collect memcached stats
    Dump time series data a json snapshot