< Summary

Class:MemoryJSDebugMetricModule
Assembly:FPSDisplay
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/Debugging/FPSDisplay/MetricsModules/MemoryJSDebugMetricModule.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:32
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetUpModule(...)0%6200%
UpdateModule()0%2100%
EnableModule()0%2100%
DisableModule()0%2100%
GetMemoryMetric(...)0%2100%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/WorldRuntime/Debugging/FPSDisplay/MetricsModules/MemoryJSDebugMetricModule.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using DCL;
 4using DCL.Controllers;
 5using DCL.FPSDisplay;
 6using DCL.Interface;
 7
 8public class MemoryJSDebugMetricModule : IDebugMetricModule
 9{
 10
 11    private const string NO_DECIMALS = "##";
 12    private const float BYTES_TO_MEGABYTES = 1048576f;
 13
 014    private BaseVariable<float> jsUsedHeapSize => DataStore.i.debugConfig.jsUsedHeapSize;
 015    private BaseVariable<float> jsTotalHeapSize => DataStore.i.debugConfig.jsTotalHeapSize;
 16
 17    public void SetUpModule(Dictionary<DebugValueEnum, Func<string>> updateValueDictionary)
 18    {
 019        updateValueDictionary.Add(DebugValueEnum.Memory_Used_JS_Heap_Size, () =>  GetMemoryMetric(jsUsedHeapSize.Get() /
 020        updateValueDictionary.Add(DebugValueEnum.Memory_Total_JS_Heap_Size, () => GetMemoryMetric(jsTotalHeapSize.Get() 
 021        updateValueDictionary.Add(DebugValueEnum.Memory_Limit_JS_Heap_Size, () => $"2048 Mb");
 022    }
 23
 024    public void UpdateModule() { WebInterface.UpdateMemoryUsage(); }
 025    public void EnableModule() {  }
 026    public void DisableModule() { }
 27
 028    private string GetMemoryMetric(float value) { return $"{FPSColoring.GetMemoryColoringString(value)}{value.ToString(N
 29
 030    public void Dispose() { }
 31
 32}