コード例 #1
0
ファイル: Statistics.cs プロジェクト: new-mikha/flytrace
        private static TimeSpan GetAverageSpan( EventQueue<TimeSpan> eventQueue, string foreignType, TimeSpan reportSpan )
        {
            int count = eventQueue.GetCount( foreignType, reportSpan );
              if ( count == 0 )
            return TimeSpan.Zero;

              TimeSpan totalSpan = eventQueue.Aggregate( foreignType, reportSpan );

              return TimeSpan.FromSeconds( totalSpan.TotalSeconds / count );
        }
コード例 #2
0
ファイル: Statistics.cs プロジェクト: new-mikha/flytrace
        private static double GetAverageCount( EventQueue<int> eventQueue, string foreignType, TimeSpan reportSpan )
        {
            int count = eventQueue.GetCount( foreignType, reportSpan );
              if ( count == 0 )
            return 0.0;

              int totalValue = eventQueue.Aggregate( foreignType, reportSpan );

              return ( ( double ) totalValue ) / count;
        }