18 instantiations of 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));
20 references to SystemResources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (11)
Calculator.cs (1)
22
public static ResourceUtilization CalculateUtilization(in Snapshot first, in Snapshot second, in
SystemResources
systemResources)
ISnapshotProvider.cs (1)
18
SystemResources
Resources { get; }
Linux\LinuxUtilizationProvider.cs (1)
37
public
SystemResources
Resources { get; }
ResourceUtilization.cs (5)
23
/// This percentage is calculated relative to the <see cref="
SystemResources
.GuaranteedCpuUnits"/>.
31
/// This percentage is calculated relative to the <see cref="
SystemResources
.GuaranteedMemoryInBytes"/>.
43
public
SystemResources
SystemResources { get; }
57
public ResourceUtilization(double cpuUsedPercentage, ulong memoryUsedInBytes,
SystemResources
systemResources)
78
internal ResourceUtilization(double cpuUsedPercentage, ulong memoryUsedInBytes,
SystemResources
systemResources, Snapshot snapShot)
SystemResources.cs (1)
49
/// Initializes a new instance of the <see cref="
SystemResources
"/> struct.
Windows\WindowsContainerSnapshotProvider.cs (1)
43
public
SystemResources
Resources { get; }
Windows\WindowsSnapshotProvider.cs (1)
19
public
SystemResources
Resources { get; }
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (9)
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(
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);
ResourceUtilizationTests.cs (1)
15
private readonly
SystemResources
_systemResources = new(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal);
SystemResourcesTests.cs (1)
17
var
systemResources = new SystemResources(CpuUnits, CpuUnits, MemoryTotalInBytes, MemoryTotalInBytes);