Пример #1
0
def do_btc_host_if(args):
    out = {}
    out["type"] = "BTC host through interface"
    out["time"] = time.time()
    out["senders"] = args.client
    out["receiver"] = args.server_listen
    out["receiver_host"] = args.server
    out["concurrent"] = args.concurrent
    if "name" in args:
        out["name"] = args.name
    print("Gathering state for host %s" % args.client)
    out["state_sender"] = os_status.get_status(args.client, False)
    print("Gathering state for host %s" % args.server)
    out["state_sender"] = os_status.get_status(args.server, False)
    out["btc"] = nuttcp.measure_btc_generic([args.server] * args.concurrent, [args.client] * args.concurrent, [args.server_listen] * args.concurrent, args.duration, False)
    emit_output(out, args)
Пример #2
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)
Пример #3
0
def do_localhost_btc(args):
    out = {}
    out["type"] = "Localhost BTC"
    out["time"] = time.time()
    out["senders"] = args.host
    out["receiver"] = "127.0.0.1"
    out["concurrent"] = args.concurrent
    if "name" in args:
        out["name"] = args.name
    print("Gathering state for host %s" % args.host)
    out["state_sender"] = os_status.get_status(args.host, False)
    print("Measuring localhost BTC on %s" % (args.host,))
    out["btc"] = nuttcp.measure_btc_localhost(args.host, args.concurrent, args.duration)
    emit_output(out, args)
Пример #4
0
 def get_status_test(self):
     ret = os_status.get_status("127.0.0.1", False)
     self.assertIsNotNone(ret)
     self.assertNotEqual(len(ret), 0)