Ejemplo n.º 1
0
def do_btc(args):
    receiver = args.receiver.split("@")
    out = {}
    out["type"] = "BTC"
    out["time"] = time.time()
    out["senders"] = args.sender
    out["receiver"] = args.receiver
    out["concurrent"] = args.concurrent
    if "name" in args:
        out["name"] = args.name
    print("Gathering state for host %s" % args.sender)
    out["state_sender"] = os_status.get_status(args.sender, args.namespace)
    print("Gathering state for host %s" % args.receiver)
    out["state_receiver"] = os_status.get_status(args.receiver, args.namespace)
    print("Measuring BTC from %s to %s" % (args.sender, args.receiver))
    out["btc"] = nuttcp.measure_btc(args.receiver, [args.sender] * args.concurrent, args.duration, args.namespace)
    emit_output(out, args)
Ejemplo n.º 2
0
 def measure_btc_test(self):
     ret = nuttcp.measure_btc("127.0.0.1", ["127.0.0.1"]*2, 5, False)
     self.assertEqual(len(ret), 2)