|
|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
Measure latency of SSH RPC.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
import getpass
|
|
|
|
|
|
|
|
|
|
import mitogen.core
|
|
|
|
|
import mitogen.utils
|
|
|
|
|
@ -21,7 +21,21 @@ def do_nothing():
|
|
|
|
|
|
|
|
|
|
@mitogen.main()
|
|
|
|
|
def main(router):
|
|
|
|
|
f = router.ssh(hostname=sys.argv[1])
|
|
|
|
|
import optparse
|
|
|
|
|
parser = optparse.OptionParser(description=__doc__)
|
|
|
|
|
parser.add_option(
|
|
|
|
|
'-p', '--python', metavar='CMD', default='python3',
|
|
|
|
|
help='Remote python path (default %default)')
|
|
|
|
|
parser.add_option(
|
|
|
|
|
'-u', '--user', metavar='S', default=getpass.getuser(),
|
|
|
|
|
help='Remote username (default %default)')
|
|
|
|
|
parser.add_option('--debug', action='store_true')
|
|
|
|
|
opts, args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
f = router.ssh(
|
|
|
|
|
hostname=args[0], python_path=opts.python, username=opts.user,
|
|
|
|
|
debug=opts.debug,
|
|
|
|
|
)
|
|
|
|
|
f.call(do_nothing)
|
|
|
|
|
t0 = mitogen.core.now()
|
|
|
|
|
end = mitogen.core.now() + 5.0
|
|
|
|
|
|