7 implementations of Resources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
Linux\LinuxUtilizationProvider.cs (1)
37public SystemResources Resources { get; }
Windows\WindowsContainerSnapshotProvider.cs (1)
43public SystemResources Resources { get; }
Windows\WindowsSnapshotProvider.cs (1)
19public SystemResources Resources { get; }
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (4)
Helpers\DummyProvider.cs (1)
19public SystemResources Resources => new(
Providers\ConditionallyFaultProvider.cs (1)
25public SystemResources Resources => new(CpuUnits, CpuUnits, TotalMemory, TotalMemory);
Providers\FakeProvider.cs (1)
17public SystemResources Resources => new(1.0, 1.0, 1000, 1000);
Providers\FaultProvider.cs (1)
15public SystemResources Resources => new(1.0, 1.0, 1000, 1000);
11 references to Resources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
ResourceMonitorService.cs (1)
101return Calculator.CalculateUtilization(t.first, t.last, _provider.Resources);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Linux\AcceptanceTest.cs (9)
36Assert.NotEqual(default, provider.Resources); 132Assert.Equal(1, provider.Resources.GuaranteedCpuUnits); // hack to make hardcoded calculation in resource utilization main package work. 133Assert.Equal(2.0d, provider.Resources.MaximumCpuUnits); // read from cpuset.cpus 134Assert.Equal(100_000UL, provider.Resources.GuaranteedMemoryInBytes); // read from memory.limit_in_bytes 138Assert.Equal(100_000UL, provider.Resources.MaximumMemoryInBytes); 180Assert.Equal(0.1, Math.Round(provider.Resources.GuaranteedCpuUnits, 1)); // hack to make hardcoded calculation in resource utilization main package work. 181Assert.Equal(0.2d, Math.Round(provider.Resources.MaximumCpuUnits, 1)); // read from cpuset.cpus 182Assert.Equal(100_000UL, provider.Resources.GuaranteedMemoryInBytes); // read from memory.max 186Assert.Equal(100_000UL, provider.Resources.MaximumMemoryInBytes);
ResourceMonitoringServiceTests.cs (1)
640providerMock.Setup(x => x.Resources)