Example #1
0
        internal void PrintTables(LogStatsParams statsParams, Totals totals)
        {
            foreach (CompareMethod method in statsParams.Options.Keys)
            {
                int tot = statsParams.Options[method];

                foreach (Total table in totals.GetTotals())
                {
                    Sorter sorter = new Sorter(table.GetValues());

                    ArrayList values = sorter.SortBy(method);
                    values.Reverse(); // maximum to minimum

                    if (tot < int.MaxValue)
                    {
                        if (values.Count > tot)
                            values = values.GetRange(0, tot);
                    }

                    Console.WriteLine();
                    Console.WriteLine("{0} {1}", table.GetName(), method.ToString());
                    PrintTable(values);
                }
            }
        }
Example #2
0
        internal Totals Parse(LogStatsParams logParams, InputReader inputReader)
        {
            int lineCount = 0;
            Totals totals = new Totals(logParams.GroupByMode);

            string line;

            while ((line = inputReader.ReadLine()) != null)
            {
                ++lineCount;
                try
                {
                    LogEntry entry = ReadEntry(line, logParams.HasToFailOnError);
                    totals.SumEntry(entry);
                }
                catch (Exception e)
                {
                    string msg = string.Format("(line {0}) {1}", lineCount, e.Message);
                    if (logParams.HasToFailOnError)
                        throw new Exception(msg);
                    else
                        LogError(msg);
                }
            }

            Console.WriteLine("{0} lines read", lineCount);
            return totals;
        }
Example #3
0
        internal void PrintTotals(Totals totals)
        {
            ulong totRecv = 0;
            ulong totRecvTime = 0;
            ulong totSent = 0;
            ulong totSentTime = 0;
            ulong totCalls = 0;
            ulong totProcTime = 0;
            ulong totDeserTime = 0;
            ulong totMethodTime = 0;
            ulong totSerTime = 0;
            ulong totZipTime = 0;

            foreach (Total total in totals.GetTotals())
            {
                foreach (TotalEntry entry in total.GetValues())
                {
                    totRecv += entry.RecvBytes;
                    totRecvTime += entry.RecvTime;
                    totSent += entry.SentBytes;
                    totSentTime += entry.SentTime;
                    totCalls += entry.CallCount;
                    totProcTime += entry.ProcTime;
                    totDeserTime += entry.DeserTime;
                    totMethodTime += entry.MethodTime;
                    totSerTime += entry.SerTime;
                    totZipTime += entry.ZipTime;
                }
            }

            Console.WriteLine("");
            Console.WriteLine("Total Recv {0, 10:F} Mb", GetMb(totRecv));
            Console.WriteLine("Total Recv {0, 10:F} min", GetMin(totRecvTime));
            Console.WriteLine("Total Sent {0, 10:F} Mb", GetMb(totSent));
            Console.WriteLine("Total Sent {0, 10:F} min", GetMin(totSentTime));
            Console.WriteLine("Total Call {0, 10} ", totCalls);
            Console.WriteLine("Total Time {0, 10:F} min", GetMin(totProcTime));
            Console.WriteLine("\tTotal Deserialization {0, 10:F} min", GetMin(totDeserTime));
            Console.WriteLine("\tTotal Method call     {0, 10:F} min", GetMin(totMethodTime));
            Console.WriteLine("\tTotal Serialization   {0, 10:F} min", GetMin(totSerTime));
            Console.WriteLine("\tTotal Zip             {0, 10:F} min", GetMin(totZipTime));
        }