4 instantiations of ResourceUtilization
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Calculator.cs (1)
43return new ResourceUtilization(cpuUtilization, second.MemoryUsageInBytes, systemResources, second);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (3)
Helpers\DummyTracker.cs (1)
16public ResourceUtilization GetUtilization(TimeSpan aggregationPeriod) => new(CpuPercentage, MemoryUsed, new SystemResources(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal));
ResourceUtilizationTests.cs (2)
20var utilization = new ResourceUtilization(CpuPercentage, MemoryUsed, _systemResources); 33Assert.Throws<ArgumentOutOfRangeException>(() => new ResourceUtilization(-50.0, 500, _systemResources));
30 references to ResourceUtilization
Microsoft.Extensions.Diagnostics.ResourceMonitoring (8)
Calculator.cs (1)
22public static ResourceUtilization CalculateUtilization(in Snapshot first, in Snapshot second, in SystemResources systemResources)
IResourceMonitor.cs (1)
21ResourceUtilization GetUtilization(TimeSpan window);
IResourceUtilizationPublisher.cs (1)
28ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken);
ResourceMonitoringOptions.cs (1)
47/// Gets or sets the observation window used to calculate the <see cref="ResourceUtilization"/> instances pushed to publishers.
ResourceMonitorService.cs (2)
88public ResourceUtilization GetUtilization(TimeSpan window) 107var u = GetUtilization(_publishingWindow);
ResourceUtilization.cs (2)
52/// Initializes a new instance of the <see cref="ResourceUtilization"/> struct. 72/// Initializes a new instance of the <see cref="ResourceUtilization"/> struct.
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (22)
CalculatorTests.cs (6)
47ResourceUtilization record = Calculator.CalculateUtilization(_firstSnapshot, second, _resources); 83ResourceUtilization record = Calculator.CalculateUtilization(_firstSnapshot, second, limitedResources); 103ResourceUtilization record = Calculator.CalculateUtilization(_firstSnapshot, secondSnapshot, _resources); 133ResourceUtilization record = Calculator.CalculateUtilization(firstSnapshot, secondSnapshot, _resources); 156ResourceUtilization record = Calculator.CalculateUtilization(_firstSnapshot, secondSnapshot, _resources); 190ResourceUtilization record = Calculator.CalculateUtilization(_firstSnapshot, secondSnapshot, _resources);
Helpers\DummyTracker.cs (1)
16public ResourceUtilization GetUtilization(TimeSpan aggregationPeriod) => new(CpuPercentage, MemoryUsed, new SystemResources(CpuUnits, CpuUnits, MemoryTotal, MemoryTotal));
IResourceUtilizationTrackerTests.cs (1)
16var utilization = tracker.GetUtilization(TimeSpan.Zero);
Linux\AcceptanceTest.cs (2)
244var utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5)); 328var utilization = tracker.GetUtilization(TimeSpan.FromSeconds(5));
Linux\Resources\GenericPublisher.cs (3)
15private readonly Action<ResourceUtilization> _publish; 16public GenericPublisher(Action<ResourceUtilization> publish) 22public ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken)
Publishers\AnotherPublisher.cs (1)
15public ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken)
Publishers\EmptyPublisher.cs (1)
15public ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken)
Publishers\FaultPublisher.cs (1)
16public async ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken)
Publishers\GenericPublisher.cs (3)
15private readonly Action<ResourceUtilization> _publish; 16public GenericPublisher(Action<ResourceUtilization> publish) 22public ValueTask PublishAsync(ResourceUtilization utilization, CancellationToken cancellationToken)
ResourceMonitoringServiceTests.cs (2)
475var utilization = tracker.GetUtilization(options.CollectionWindow); 579var utilization = tracker.GetUtilization(options.CollectionWindow);
ResourceUtilizationTests.cs (1)
20var utilization = new ResourceUtilization(CpuPercentage, MemoryUsed, _systemResources);