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()
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)
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)
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))
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))