18 instantiations of SystemResources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (3)
Linux\LinuxUtilizationProvider.cs (1)
79Resources = new SystemResources(cpuRequest, cpuLimit, _memoryLimit, _memoryLimit);
Windows\WindowsContainerSnapshotProvider.cs (1)
93Resources = new SystemResources(cpuRequest, _cpuLimit, memoryRequest, memoryLimitLong);
Windows\WindowsSnapshotProvider.cs (1)
65Resources = new SystemResources(_cpuUnits, _cpuUnits, totalMemory, totalMemory);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (15)
CalculatorTests.cs (3)
23private readonly SystemResources _resources = new(CpuUnits, CpuUnits, TotalMemoryInBytes, TotalMemoryInBytes); 64SystemResources limitedResources = new(guaranteedCpuUnits: 0.5, maximumCpuUnits: 0.5, TotalMemoryInBytes, TotalMemoryInBytes); 174SystemResources limitedResources = new(cpuUnits, cpuUnits, TotalMemoryInBytes, TotalMemoryInBytes);
Helpers\DummyProvider.cs (1)
19public SystemResources Resources => new(
Helpers\DummyTracker.cs (1)
16public ResourceUtilization GetUtilization(TimeSpan aggregationPeriod) => new(CpuPercentage, MemoryUsed, new SystemResources(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal));
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);
ResourceMonitoringServiceTests.cs (1)
641.Returns(new SystemResources(1.0, 1.0, 100, 100));
ResourceUtilizationTests.cs (1)
15private readonly SystemResources _systemResources = new(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal);
SystemResourcesTests.cs (5)
17var systemResources = new SystemResources(CpuUnits, CpuUnits, MemoryTotalInBytes, MemoryTotalInBytes); 29Assert.Throws<ArgumentOutOfRangeException>(() => new SystemResources(0.0, 1.0, 1000UL, 1000UL)); 31Assert.Throws<ArgumentOutOfRangeException>(() => new SystemResources(1.0, 0.0, 1000UL, 1000UL)); 34Assert.Throws<ArgumentOutOfRangeException>(() => new SystemResources(1.0, 1.0, 0UL, 1000UL)); 36Assert.Throws<ArgumentOutOfRangeException>(() => new SystemResources(1.0, 1.0, 1000UL, 0UL));
20 references to SystemResources
Microsoft.Extensions.Diagnostics.ResourceMonitoring (11)
Calculator.cs (1)
22public static ResourceUtilization CalculateUtilization(in Snapshot first, in Snapshot second, in SystemResources systemResources)
ISnapshotProvider.cs (1)
18SystemResources Resources { get; }
Linux\LinuxUtilizationProvider.cs (1)
37public 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"/>. 43public SystemResources SystemResources { get; } 57public ResourceUtilization(double cpuUsedPercentage, ulong memoryUsedInBytes, SystemResources systemResources) 78internal 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)
43public SystemResources Resources { get; }
Windows\WindowsSnapshotProvider.cs (1)
19public SystemResources Resources { get; }
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (9)
CalculatorTests.cs (3)
23private readonly SystemResources _resources = new(CpuUnits, CpuUnits, TotalMemoryInBytes, TotalMemoryInBytes); 64SystemResources limitedResources = new(guaranteedCpuUnits: 0.5, maximumCpuUnits: 0.5, TotalMemoryInBytes, TotalMemoryInBytes); 174SystemResources limitedResources = new(cpuUnits, cpuUnits, TotalMemoryInBytes, TotalMemoryInBytes);
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);
ResourceUtilizationTests.cs (1)
15private readonly SystemResources _systemResources = new(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal);
SystemResourcesTests.cs (1)
17var systemResources = new SystemResources(CpuUnits, CpuUnits, MemoryTotalInBytes, MemoryTotalInBytes);