add the following to your CustomRules.js and you should see the
behavior you're after...
//start ResponseTiming
// Description:
// This FiddlerScript sample logs values from all currently
// selected sessions to a file in Tab Separated Value (TSV)
// format.
// Notes:
// * The log file will be created in the Capture folder and
// has the name: ResponseTiming.log
// * Subsequent executions of this script will overwrite the
// the previous ResponseTiming.log file.
// * This script will run against any highlighted Fiddler
// sessions, whether Capture is enabled or not, but it will
// not automatically refresh the log if new Sessions are
// captured.
// Version History:
// * 2009-05-09: initial release
// Usage:
// 1. launch Fiddler
// 2. navigate to Rules > Customize Rules...
// 3. add the following text at the top of the file:
// import System.IO;
// 4. go to very end of file
// 5. paste all lines between 'start ResponseTiming' and
// 'end ResponseTiming' above the last close curly brace: }
// 6. choose Yes when prompted to Save Changes
// 7. navigate to Tools > Log ResponseTimes for Selected
Sessions
// 8. open the .log file in %USERPROFILE%\Documents
\Fiddler2\Capture
// in Microsoft Excel or other editor of choice.
//
public static ToolsAction("Log ResponseTimes for Selected Sessions")
function DoLogSessions(oSessions: Fiddler.Session[])
{
if (null == oSessions || oSessions.Length < 1)
{
MessageBox.Show("Please select some sessions first!");
return;
}
var strLogFile = CONFIG.GetPath("Captures") + "ResponseTimes.log";
var swLogFile:StreamWriter = null;
try
{
swLogFile = File.CreateText(strLogFile);
//set the headings for the log file
swLogFile.Write("method\t");
swLogFile.Write("protocol\t");
swLogFile.Write("host\t");
swLogFile.Write("ServerPort\t");
swLogFile.Write("uri-stem\t");
swLogFile.Write("Status\t");
swLogFile.Write("ResponseBodySize\t");
swLogFile.Write("ServerIP\t");
swLogFile.Write("ProcessInfo\t");
swLogFile.Write("ClientPort\t");
swLogFile.Write("Proxy\t");
swLogFile.Write("RequestStart\t");
swLogFile.Write("ResponseFinish\t");
swLogFile.Write("TotalMilliseconds\t");
swLogFile.Write("CompressNone\t");
swLogFile.Write("CompressDeflate\t");
swLogFile.WriteLine("CompressGZip");
for (var x = 0; x < oSessions.Length; x++)
{
swLogFile.Write(oSessions[x].oRequest.headers.HTTPMethod + "\t");
swLogFile.Write((oSessions[x].oRequest.headers.UriScheme).ToUpper
() + "\t");
swLogFile.Write(oSessions[x].host + "\t");
swLogFile.Write(oSessions[x].port + "\t");
swLogFile.Write(oSessions[x].oRequest.headers.RequestPath + "\t");
swLogFile.Write(oSessions[x].responseCode + "\t");
swLogFile.Write(oSessions[x].responseBodyBytes.Length + "\t");
swLogFile.Write(oSessions[x].oFlags["x-hostIP"] + "\t");
swLogFile.Write(oSessions[x].oFlags["x-ProcessInfo"] + "\t");
swLogFile.Write(oSessions[x].oFlags["x-clientPort"] + "\t");
if (oSessions[x].oResponse.headers.Exists("Via"))
swLogFile.Write(oSessions[x].oResponse["Via"] + "\t");
else
swLogFile.Write("\t");
var RequestStart:DateTime = oSessions[x].Timers.ClientConnected;
var ResponseFinish:DateTime = oSessions
[x].Timers.ClientDoneResponse;
if (RequestStart != null)
swLogFile.Write(RequestStart.ToString("yyyy-MM-dd
HH:mm:ss.fffff") + "Z\t");
else
swLogFile.Write("\t");
if (ResponseFinish != null)
swLogFile.Write(ResponseFinish.ToString("yyyy-MM-dd
HH:mm:ss.fffff") + "Z\t");
else
swLogFile.Write("\t");
if (ResponseFinish == null || RequestStart == null)
swLogFile.Write("\t");
else
swLogFile.Write((ResponseFinish - RequestStart).TotalMilliseconds
+ "\t");
oSessions[x].utilDecodeResponse();
swLogFile.Write(oSessions[x].oResponse["Content-Length"] + "\t");
oSessions[x].utilGZIPResponse();
swLogFile.Write(oSessions[x].oResponse["Content-Length"] + "\t");
oSessions[x].utilDecodeResponse();
oSessions[x].utilDeflateResponse();
swLogFile.WriteLine(oSessions[x].oResponse["Content-Length"] +
"\t");
}
}
catch (ex)
{
MessageBox.Show(ex);
}
finally
{
if (swLogFile != null )
{
swLogFile.Close();
swLogFile.Dispose();
}
}
}
//end ResponseTiming
> > - Show quoted text -- Hide quoted text -