示例#1
0
def test_speed(addr):
    report = sh.mtr(addr, '--report')
    for line in reversed(map(unicode.strip, report.splitlines())):
        if line:
            break
    # 18.|-- speedtest.frankfurt.linod  0.0%     9  161.4 184.5 160.0 321.3  52.0
    segs = line.split()
    loss, avg, std, worst = float(segs[-7].rstrip('%')), float(segs[-4]), float(segs[-1]), float(segs[-2])
    return loss, avg, std, worst
示例#2
0
文件: glass.py 项目: malaiwah/lg
def mtr(dest, count=10):
    return sh.mtr(dest, b=True, r=True, w=True, c=count, _ok_code=[0, 1])
示例#3
0
文件: glass.py 项目: ctaloi/lg
def mtr(dest, count=10):
    return sh.mtr(dest, r=True, w=True, c=count, _ok_code=[0, 1])
示例#4
0
文件: mtrpy.py 项目: bsdlp/mtrpy
 def report_mtr(self):
     report = mtr("--report-wide", self.client_ip, _bg=True)
     return report.wait()