< Summary

Class:DCL.FPSDisplay.LinealBufferFPSCounter
Assembly:PerformanceController
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/Debugging/Performance/LinealBufferFPSCounter.cs
Covered lines:20
Uncovered lines:1
Coverable lines:21
Total lines:44
Line coverage:95.2% (20 of 21)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
LinealBufferFPSCounter()0%110100%
AddDeltaTime(...)0%440100%
CurrentFPSCount()0%110100%
GetTotalSeconds()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/Debugging/Performance/LinealBufferFPSCounter.cs

#LineLine coverage
 1namespace DCL.FPSDisplay
 2{
 3    public class LinealBufferFPSCounter
 4    {
 5        public const int MAX_BUFFER_SIZE = 1000;
 46        public readonly float[] values = new float[MAX_BUFFER_SIZE];
 7
 140188        public int begin { get; private set; } = 0;
 199389        public int end { get; private set; } = 0;
 2161510        public float secondsBetweenBeginAndEnd { get; private set; } = 0;
 1441011        public float secondsInBuffer { get; private set; } = 0;
 1441112        public int countBetweenBeginAndEnd { get; private set; } = 0;
 13
 14        public void AddDeltaTime(float valueInSeconds)
 15        {
 370116            values[end++] = valueInSeconds;
 370117            secondsInBuffer += valueInSeconds;
 370118            secondsBetweenBeginAndEnd += valueInSeconds;
 370119            countBetweenBeginAndEnd++;
 20
 370121            if (end == MAX_BUFFER_SIZE)
 322                end = 0;
 23
 720524            while (secondsBetweenBeginAndEnd > 1)
 25            {
 350426                secondsInBuffer -= values[begin];
 350427                secondsBetweenBeginAndEnd -= values[begin++];
 350428                countBetweenBeginAndEnd--;
 350429                if (begin == MAX_BUFFER_SIZE)
 230                    begin = 0;
 31            }
 370132        }
 33
 34        public float CurrentFPSCount()
 35        {
 136            return countBetweenBeginAndEnd;
 37        }
 38
 39        public float GetTotalSeconds()
 40        {
 041            return secondsInBuffer;
 42        }
 43    }
 44}