fiddler弱网测试

设置方法:
勾选Rules –> Performances –> Simulate Modem Speeds
设置网速:
Rules – Customize Rules(快捷键Ctrl + R)打开Fiddler ScriptEditor,或者直接点开右侧主页签的FiddlerScript

打开该文件后,m_SimulateModem标志位

注:
①、request-trickle-delay中的值代表每KB的数据被上传时会被延时多少毫秒
②、response-trickle-delay则对应下载时每KB的数据会被延时多少毫
举个栗子:比如要模拟上传速度100KBps的网络,那上传延迟就是1KB/100KBps=0.01s=10ms,就改成10

随机延时量设置

static function randInt(min, max) {
    return Math.round(Math.random()*(max-min)+min);
}
  if (m_SimulateModem) {
      // Delay sends by 300ms per KB uploaded.
      oSession["request-trickle-delay"] = ""+randInt(100,200);
      // Delay receives by 150ms per KB downloaded.
      oSession["response-trickle-delay"] = ""+randInt(1,50);
}

你可能感兴趣的:(fiddler弱网测试)