private static Timings GetTimings(SessionTimers timers) { var timings = new Timings { blocked = -1, dns = timers.DNSTime, connect = timers.TCPConnectTime + timers.HTTPSHandshakeTime, ssl = timers.HTTPSHandshakeTime }; TimeSpan span = timers.ServerGotRequest - timers.FiddlerBeginRequest; timings.send = (int)Math.Max(0.0, Math.Round(span.TotalMilliseconds)); TimeSpan span2 = timers.ServerBeginResponse - timers.ServerGotRequest; timings.wait = (int)Math.Max(0.0, Math.Round(span2.TotalMilliseconds)); TimeSpan span3 = timers.ServerDoneResponse - timers.ServerBeginResponse; timings.receive = (int)Math.Max(0.0, Math.Round(span3.TotalMilliseconds)); return timings; }
private static int GetTotalTime(Timings timings) { int total = 0; total += timings.blocked; total += timings.dns; total += timings.connect; total += timings.send; total += timings.wait; total += timings.receive; return total; }
private static void AddTimings(Table table, Timings timings, int time) { if (timings == null) { return; } Table subtable = CreateSubtable("timings", table); var row = new TableRow(); subtable.Rows.Add(row); AddTextRow("ssl", timings.ssl, subtable); //AddTextRow("blocked", timings.blocked, subtable); AddTextRow("dns", timings.dns, subtable); AddTextRow("connect", timings.connect, subtable); AddTextRow("send", timings.send, subtable); AddTextRow("wait", timings.wait, subtable); AddTextRow("receive", timings.receive, subtable); AddTextRow("TOTAL", time, subtable); AddTextRow("comment", timings.comment, subtable); }