< Summary

Class:DCL.FPSDisplay.LinealBufferHiccupCounter
Assembly:PerformanceController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/Performance/LinealBufferHiccupCounter.cs
Covered lines:11
Uncovered lines:7
Coverable lines:18
Total lines:43
Line coverage:61.1% (11 of 18)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LinealBufferHiccupCounter()0%110100%
CurrentFPSCount()0%2100%
GetTotalSeconds()0%2100%
AddDeltaTime(...)0%330100%
CurrentHiccupCount()0%2100%
IsHiccup(...)0%2100%
GetHiccupSum()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/Debugging/Performance/LinealBufferHiccupCounter.cs

#LineLine coverage
 1namespace DCL.FPSDisplay
 2{
 3    public class LinealBufferHiccupCounter
 4    {
 45        private readonly LinealBufferFPSCounter counter = new LinealBufferFPSCounter();
 6        private int hiccupsCountInBuffer = 0;
 7        private float hiccupsSum = 0.0f;
 8        private float bufferCount = 0.0f;
 9
 010        public int HiccupsCountInBuffer { get => hiccupsCountInBuffer; private set => hiccupsCountInBuffer = value; }
 011        public float HiccupsSum { get => hiccupsSum; set => hiccupsSum = value; }
 12
 013        public float CurrentFPSCount() { return counter.CurrentFPSCount(); }
 14
 015        public float GetTotalSeconds() { return bufferCount; }
 16
 17        public void AddDeltaTime(float valueInSeconds)
 18        {
 370119            if (IsHiccup(counter.values[counter.end]))
 20            {
 142721                hiccupsCountInBuffer -= 1;
 142722                hiccupsSum -= counter.values[counter.end];
 23            }
 24
 370125            if (IsHiccup(valueInSeconds))
 26            {
 333427                hiccupsCountInBuffer += 1;
 333428                hiccupsSum += valueInSeconds;
 29            }
 30
 370131            bufferCount -= counter.values[counter.end];
 370132            bufferCount += valueInSeconds;
 33
 370134            counter.AddDeltaTime(valueInSeconds);
 370135        }
 36
 037        public int CurrentHiccupCount() { return hiccupsCountInBuffer; }
 38
 039        private bool IsHiccup(float value) { return value > FPSEvaluation.HICCUP_THRESHOLD_IN_SECONDS; }
 40
 041        public float GetHiccupSum() { return hiccupsSum; }
 42    }
 43}