18 references to SystemResources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
Linux\LinuxUtilizationProvider.cs (1)
79
Resources = new
SystemResources
(cpuRequest, cpuLimit, _memoryLimit, _memoryLimit);
Windows\WindowsContainerSnapshotProvider.cs (1)
93
Resources = new
SystemResources
(cpuRequest, _cpuLimit, memoryRequest, memoryLimitLong);
Windows\WindowsSnapshotProvider.cs (1)
65
Resources = new
SystemResources
(_cpuUnits, _cpuUnits, totalMemory, totalMemory);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (15)
CalculatorTests.cs (3)
23
private readonly SystemResources _resources =
new
(CpuUnits, CpuUnits, TotalMemoryInBytes, TotalMemoryInBytes);
64
SystemResources limitedResources =
new
(guaranteedCpuUnits: 0.5, maximumCpuUnits: 0.5, TotalMemoryInBytes, TotalMemoryInBytes);
174
SystemResources limitedResources =
new
(cpuUnits, cpuUnits, TotalMemoryInBytes, TotalMemoryInBytes);
Helpers\DummyProvider.cs (1)
19
public SystemResources Resources =>
new
(
Helpers\DummyTracker.cs (1)
16
public ResourceUtilization GetUtilization(TimeSpan aggregationPeriod) => new(CpuPercentage, MemoryUsed, new
SystemResources
(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal));
Providers\ConditionallyFaultProvider.cs (1)
25
public SystemResources Resources =>
new
(CpuUnits, CpuUnits, TotalMemory, TotalMemory);
Providers\FakeProvider.cs (1)
17
public SystemResources Resources =>
new
(1.0, 1.0, 1000, 1000);
Providers\FaultProvider.cs (1)
15
public SystemResources Resources =>
new
(1.0, 1.0, 1000, 1000);
ResourceMonitoringServiceTests.cs (1)
641
.Returns(new
SystemResources
(1.0, 1.0, 100, 100));
ResourceUtilizationTests.cs (1)
15
private readonly SystemResources _systemResources =
new
(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal);
SystemResourcesTests.cs (5)
17
var systemResources = new
SystemResources
(CpuUnits, CpuUnits, MemoryTotalInBytes, MemoryTotalInBytes);
29
Assert.Throws<ArgumentOutOfRangeException>(() => new
SystemResources
(0.0, 1.0, 1000UL, 1000UL));
31
Assert.Throws<ArgumentOutOfRangeException>(() => new
SystemResources
(1.0, 0.0, 1000UL, 1000UL));
34
Assert.Throws<ArgumentOutOfRangeException>(() => new
SystemResources
(1.0, 1.0, 0UL, 1000UL));
36
Assert.Throws<ArgumentOutOfRangeException>(() => new
SystemResources
(1.0, 1.0, 1000UL, 0UL));