public ManagerTab() { columeEachAlgo = ALGO_RESULT_COLUMES.Length; algoNb = Enum.GetValues(typeof(OrderAlgo)).Length; columeNb = FIRST_NUMERIC_COLUME + columeEachAlgo * algoNb; sortedAlgos = new List <OrderAlgo>(); aggregatedStatistics = new AggregatedStatistics(); }
protected override async Task <Response> CreateInternalResponseAsync( DateRangeDomainRequest request) { AggregatedStatistics aggregatedStatistics = await AggregateReportApiDao .GetAggregatedComplianceStatisticsAsync(request.BeginDateUtc.Value, request.EndDateUtc.Value, request.DomainId); return(new AggregatedStatisticsResponse(aggregatedStatistics.Values)); }
/// <summary> /// Get statistics for last second of the video stream. /// </summary> public AggregatedStatistics GetAggregatedResult() { AggregatedStatistics s = new AggregatedStatistics(); foreach (FrameStatistics frameStatistics in _lastWindowFrameStats) { s.TimeSinceLastPresentAvg += frameStatistics.TimeSinceLastPresent; s.TimeSinceLastPresentMax = Math.Max(s.TimeSinceLastPresentMax, frameStatistics.TimeSinceLastPresent); s.VideoFramesSkipped += frameStatistics.VideoFramesSkipped; s.VideoFramesReused += frameStatistics.VideoFrameReusedCount > 0 ? 1 : 0; s.VideoFramesReceived += frameStatistics.VideoFramesReceived; if (frameStatistics.VideoFramesReceived > 0) { if (s.VideoFrameMinDelta == 0.0f) { s.VideoFrameMinDelta = frameStatistics.VideoFrameMinDelta; s.VideoFrameMaxDelta = frameStatistics.VideoFrameMaxDelta; } else { s.VideoFrameMinDelta = Math.Min(s.VideoFrameMinDelta, frameStatistics.VideoFrameMinDelta); s.VideoFrameMaxDelta = Math.Max(s.VideoFrameMaxDelta, frameStatistics.VideoFrameMaxDelta); } } s.LatencyPoseToReceiveAvg += frameStatistics.LatencyPoseToReceive; s.LatencyReceiveToPresentAvg += frameStatistics.LatencyReceiveToPresent; s.LatencyPresentToDisplayAvg += frameStatistics.LatencyPresentToDisplay; s.VideoFramesDiscarded += frameStatistics.VideoFramesDiscarded; } int frameStatsCount = _lastWindowFrameStats.Count; if (frameStatsCount > 0) { s.TimeSinceLastPresentAvg /= (float)frameStatsCount; s.LatencyPoseToReceiveAvg /= (float)frameStatsCount; s.LatencyReceiveToPresentAvg /= (float)frameStatsCount; s.LatencyPresentToDisplayAvg /= (float)frameStatsCount; } s.VideoFramesDiscardedTotal = _videoFramesDiscardedTotal; s.FramesUsedForAverage = frameStatsCount; s.CurrentPerformanceAssessment = m_lastPerformanceAssessment; return(s); }
/// <summary> /// Utility call to get the statistics in formatted string. /// </summary> public string GetStatsString() { AggregatedStatistics s = GetAggregatedResult(); return(s.ToString()); }