コード例 #1
0
ファイル: Totals.cs プロジェクト: danipen/SmokeTest
 public int CompareTo(TotalEntry y, CompareMethod method)
 {
     switch (method)
     {
         case CompareMethod.recvBytes: return RecvBytes.CompareTo(y.RecvBytes);
         case CompareMethod.recvTime: return RecvTime.CompareTo(y.RecvTime);
         case CompareMethod.sentBytes: return SentBytes.CompareTo(y.SentBytes);
         case CompareMethod.sentTime: return SentBytes.CompareTo(y.SentTime);
         case CompareMethod.proc: return ProcTime.CompareTo(y.ProcTime);
         case CompareMethod.method: return Method.CompareTo(y.Method);
         case CompareMethod.call: return CallCount.CompareTo(y.CallCount);
         case CompareMethod.deserTime: return DeserTime.CompareTo(y.DeserTime);
         case CompareMethod.methodTime: return MethodTime.CompareTo(y.MethodTime);
         case CompareMethod.serTime: return SerTime.CompareTo(y.SerTime);
         case CompareMethod.zipTime: return ZipTime.CompareTo(y.ZipTime);
     }
     return 0;
 }
コード例 #2
0
ファイル: Totals.cs プロジェクト: danipen/SmokeTest
 internal void Add(string method, TotalEntry entry)
 {
     mValues[method] = entry;
 }
コード例 #3
0
ファイル: Totals.cs プロジェクト: danipen/SmokeTest
        internal void SumEntry(LogEntry entry)
        {
            TotalEntry totalEntry;

            string key = GetKey(entry);
            Total totals = (Total)mTotals[key];

            if (totals == null)
            {
                totals = new Total(key);
                mTotals.Add(key, totals);
            }

            if (totals.Contains(GetMethod(entry)))
            {
                totalEntry = totals.Get(GetMethod(entry));
            }
            else
            {
                totalEntry = new TotalEntry();
                totalEntry.RecvBytes = 0;
                totalEntry.RecvTime = 0;
                totalEntry.SentBytes = 0;
                totalEntry.SentBytes = 0;
                totalEntry.ProcTime = 0;
                totalEntry.DeserTime = 0;
                totalEntry.MethodTime = 0;
                totalEntry.SerTime = 0;
                totalEntry.ZipTime = 0;
                totalEntry.Method = GetMethod(entry);
            }

            if (entry.ProcTime == 0) // entry method
                return;

            totalEntry.RecvBytes += entry.RecvBytes;
            totalEntry.RecvTime += entry.RecvTime;
            totalEntry.SentBytes += entry.SentBytes;
            totalEntry.SentTime += entry.SentTime;
            totalEntry.ProcTime += entry.ProcTime;
            totalEntry.DeserTime += entry.DeserTime;
            totalEntry.MethodTime += entry.MethodTime;
            totalEntry.SerTime += entry.SerTime;
            totalEntry.ZipTime += entry.ZipTime;
            totalEntry.CallCount += 1;

            totals.Add(GetMethod(entry), totalEntry);
        }