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.");
        }
  • 相关阅读:
    Collection集合总结
    JAVA泛型通配符T,E,K,V区别,T以及Class,Class的区别【转】
    Runnable和Thread
    jdk自带的函数式接口(配合lambda使用)
    java8-接口的静态方法(static)和默认方法(default)
    Java 8
    java8-Stream流【转】
    java8-lambda表达式
    Oracle:ORA-01461报错
    ASP.NET Core 入门笔记2,建立项目
  • 原文地址:https://www.cnblogs.com/hushaojun/p/6945650.html
Copyright © 2011-2022 走看看