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.");
        }
  • 相关阅读:
    9.2模拟题解
    NOI1995 石子合并
    NOIP2012 借教室
    织梦内页读取栏目banner图
    mysql数据库版本引发的问题
    简单修改hosts文件加快打开网页速度
    详细剖析电脑hosts文件的作用和修改
    内部标签样式
    织梦让当前的子栏目拥有特殊的样式
    织梦获取单个顶级栏目名
  • 原文地址:https://www.cnblogs.com/hushaojun/p/6945650.html
Copyright © 2011-2022 走看看