Pregunta

I am writing a custom Fiddler inspector (inheriting from Inspector2 and implementing IResponseInspector2), and one of the things I want to show in the output of the inspector is the time it took for the response to come back from the server (relative to the time the corresponding request was sent from the client).

I basically want the user to see how long the request took without them having to switch to the Timeline view.

Does anyone know if there is a way to do this?

¿Fue útil?

Solución 2

Ok - I found a way, but it seems sort of hacky - maybe there is a better way.

Session[] sessions = FiddlerApplication.UI.GetSelectedSessions();
if (sessions != null && sessions.Length == 1)
{
    Session s = sessions[0];
    if (s != null && (s.state == SessionStates.Done))
    {
        TimeSpan totalTime = s.Timers.ClientDoneResponse - s.Timers.ClientBeginRequest;
        Debug.WriteLine("Time = " + totalTime.ToString());
    }
}

I guess I want a more elegant way to get the Session associated with the response that the inspector is currently processing.

Otros consejos

in FilderScript find variable m_ShowTTLB and m_ShowTimestamp and set all to true. Show the result into Custom column

    // Show the duration between the start of Request.Send and Response.Completed in Milliseconds
    public static RulesOption("&Show Time-to-Last-Byte", "Per&formance")
    var m_ShowTTLB: boolean = true;

    // Show the time of response completion
    public static RulesOption("Show Response &Timestamp", "Per&formance")
    var m_ShowTimestamp: boolean = true;
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top