예제 #1
0
def _get_conf_services(default):
    assert type(default) in [types.NoneType, list]

    if default is not None:
        return ",".join(default)

    # dirty user's input
    slugs = ",".join(slug for (slug, _) in services.backends())
    print "input storage backends, (e.g., %s)" % slugs
    for (_, doc) in services.backends():
        print "    %s" % doc
    return raw_input("> ").strip()
예제 #2
0
def _get_conf_services(default):
    assert type(default) in [types.NoneType, list]

    if default is not None:
        return ",".join(default)

    # dirty user's input
    slugs = ",".join(slug for (slug, _) in services.backends())
    print "input storage backends, (e.g., %s)" % slugs
    for (_, doc) in services.backends():
        print "    %s" % doc
    return raw_input("> ").strip()
예제 #3
0
파일: test.py 프로젝트: dstarikov/metavault
def test_sid(metasync, opts):
    import services
    allset = set()
    for srv, doc in services.backends():
        if (srv != "disk"):
            instance = services.factory(srv)
            assert instance is not None
            sid = instance.sid()
            print(sid, instance)
            assert sid is not None
            assert sid not in allset
            allset.add(sid)
예제 #4
0
def test_sid(metasync, opts):
    import services
    allset = set()
    for srv, doc in services.backends():
        if(srv != "disk"):
            instance = services.factory(srv)
            assert instance is not None
            sid = instance.sid()
            print(sid, instance)
            assert sid is not None
            assert sid not in allset
            allset.add(sid)
예제 #5
0
파일: test.py 프로젝트: dstarikov/metavault
def test_bench_latency(metasync, opts):
    import services
    allset = set()
    path = '%d' % time.time()
    with open("/dev/urandom") as ifd:
        content = ifd.read(128)

    for srv, doc in services.backends():
        if (srv != "disk"):
            instance = services.factory(srv)
            beg = time.time()
            instance.put(path, content)
            end = time.time()
            print(srv + " up " + str(end - beg))
            beg = time.time()
            ct = instance.get(path)
            end = time.time()
            print(srv + " dn " + str(end - beg))
예제 #6
0
def test_bench_latency(metasync, opts):
    import services
    allset = set()
    path = '%d' % time.time()
    with open("/dev/urandom") as ifd:
        content = ifd.read(128)

    for srv, doc in services.backends():
        if(srv != "disk"):
            instance = services.factory(srv)
            beg = time.time()
            instance.put(path,content)
            end = time.time()
            print(srv + " up " + str(end-beg))
            beg = time.time()
            ct = instance.get(path)
            end = time.time()
            print(srv + " dn " + str(end-beg))