zoukankan      html  css  js  c++  java
  • 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.");
        }
  • 相关阅读:
    JavaSE-集合的遍历
    JavaSE-Collection常用方法
    JavaSE-异常
    JavaSE-匿名类_匿名内部类的使用
    JavaSE-内部类
    JavaSE-接口应用举例
    java线程的使用(Runnable)
    list根据所存对象属性排序
    Unable to locate appropriate constructor on class异常
    redis在java项目中的使用
  • 原文地址:https://www.cnblogs.com/hushaojun/p/6945650.html
Copyright © 2011-2022 走看看