• Performance Testing


    To test application performance, add rules using FiddlerScript to the OnBeforeResponse function (except where noted). For example:

    Simulate modem uploads (add to OnBeforeRequest function)

        // Delay sends by 300ms per KB uploaded.
        oSession["request-trickle-delay"] = "300";

    Simulate modem downloads

        // Delay receives by 150ms per KB downloaded.
        oSession["response-trickle-delay"] = "150";

    Flag content which isn't set to cache on the client.

        if (!(oSession.oResponse.headers.Exists("Expires") 
        || (oSession.oResponse.headers.ExistsAndContains("Cache-Control", "age")))
        || (oSession.oResponse.headers.Exists("Vary"))){
        {
        oSession["ui-color"]="brown"; // Use C# color strings here.
        oSession["ui-italic"]="true"; 
        }

    Display in the "Custom Column" the number of milliseconds from the moment of the request until the last byte was received.

        oSession["ui-customcolumn"] = oSession["X-TTLB"];

    Display the # of milliseconds until the First Byte was received from the server, followed by the # of ms until the Last Byte.

        oSession["ui-customcolumn"] = "FB: " + oSession["X-TTFB"] + "; LB: " + oSession["X-TTLB"];

    Add a CopyTimers context menu item to the Session List (Scope is Global)

        public static ContextAction("CopyTimers")
        function CopyTimers(oSessions: Fiddler.Session[]){
          if (null == oSessions){
            MessageBox.Show("Please select sessions to copy timers for.", "Nothing to Do");
            return;
          }
    
          var s: System.Text.StringBuilder = new System.Text.StringBuilder();
    
          for (var x = 0; x < oSessions.Length; x++)  {
            s.AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}
    ",
            oSessions[x].Timers.ClientConnected,
            oSessions[x].Timers.ClientDoneRequest,
            oSessions[x].Timers.ServerConnected,
            oSessions[x].Timers.ServerGotRequest,
            oSessions[x].Timers.ServerBeginResponse,
            oSessions[x].Timers.ServerDoneResponse,
            oSessions[x].Timers.ClientBeginResponse,
            oSessions[x].Timers.ClientDoneResponse
            );
          }
          Utilities.CopyToClipboard(s.ToString());
          MessageBox.Show("Done.");
        }
  • 相关阅读:
    11个Linux基础面试问题
    OSI模型
    戴文的Linux内核专题:10配置内核(6)
    面向对象实验四(输入输出流)
    计算机程序的思维逻辑 (2)
    计算机程序的思维逻辑 (1)
    java基础3.0:Java常用API
    java基础2.0:Object、Class、克隆、异常编程
    java基础1.0::Java面向对象、面向对象封装、抽象类、接口、static、final
    Ajax工作原理(转)
  • 原文地址:https://www.cnblogs.com/hushaojun/p/6945650.html
Copyright © 2020-2023  润新知