49 references to Throw
Microsoft.Extensions.Diagnostics.ResourceMonitoring (49)
CircularBuffer.cs (1)
17_ = Throw.IfLessThan(size, 1);
ResourceMonitoringBuilderExtensions.cs (4)
32_ = Throw.IfNull(builder); 33_ = Throw.IfNull(configure); 49_ = Throw.IfNull(builder); 50_ = Throw.IfNull(section);
ResourceMonitoringServiceCollectionExtensions.cs (3)
35_ = Throw.IfNull(services); 54_ = Throw.IfNull(services); 55_ = Throw.IfNull(configure);
ResourceMonitorService.cs (3)
73var optionsValue = Throw.IfMemberNull(options, options.Value); 90_ = Throw.IfLessThanOrEqual(window.Ticks, 0); 91_ = Throw.IfGreaterThan(window.Ticks, _collectionWindow.Ticks);
ResourceUtilization.cs (2)
68CpuUsedPercentage = Math.Min(Hundred, Throw.IfLessThan(cpuUsedPercentage / guaranteedCpuUnits, 0.0)); 69MemoryUsedInBytes = Throw.IfLessThan(memoryUsedInBytes, 0);
Snapshot.cs (6)
54_ = Throw.IfLessThan(memoryUsageInBytes, 0); 55_ = Throw.IfLessThan(kernelTimeSinceStart.Ticks, 0); 56_ = Throw.IfLessThan(userTimeSinceStart.Ticks, 0); 78_ = Throw.IfLessThan(memoryUsageInBytes, 0); 79_ = Throw.IfLessThan(kernelTimeSinceStart.Ticks, 0); 80_ = Throw.IfLessThan(userTimeSinceStart.Ticks, 0);
src\Shared\BufferWriterPool\BufferWriter.cs (4)
74_ = Throw.IfLessThan(value, 0); 121_ = Throw.IfOutOfRange(count, 0, _buffer.Length - WrittenCount); 182Throw.InvalidOperationException("Exceeded array capacity"); 189_ = Throw.IfLessThan(sizeHint, 0);
src\Shared\BufferWriterPool\BufferWriterPool.cs (2)
28_ = Throw.IfLessThan(maxCapacity, 1); 29_ = Throw.IfLessThan(maxBufferWriterCapacity, 1);
src\Shared\BufferWriterPool\BufferWriterPooledObjectPolicy.cs (2)
37MaximumRetainedCapacity = Throw.IfLessThan(maximumRetainedCapacity, 1); 63_ = Throw.IfNull(obj);
src\Shared\Data.Validation\TimeSpanAttribute.cs (3)
88_ = Throw.IfNullOrWhitespace(min); 101_ = Throw.IfNullOrWhitespace(min); 102_ = Throw.IfNullOrWhitespace(max);
src\Shared\Pools\PoolFactory.cs (12)
42_ = Throw.IfLessThan(maxCapacity, 1); 57_ = Throw.IfNull(policy); 58_ = Throw.IfLessThan(maxCapacity, 1); 75_ = Throw.IfLessThan(maxCapacity, 1); 88_ = Throw.IfLessThan(maxCapacity, 1); 89_ = Throw.IfLessThan(maxStringBuilderCapacity, 1); 116_ = Throw.IfLessThan(maxCapacity, 1); 134_ = Throw.IfLessThan(maxCapacity, 1); 135_ = Throw.IfLessThan(listCapacity, 0); 155_ = Throw.IfLessThan(maxCapacity, 1); 174_ = Throw.IfLessThan(maxCapacity, 1); 196_ = Throw.IfLessThan(maxCapacity, 1);
src\Shared\StringSplit\StringRange.cs (3)
25_ = Throw.IfLessThan(index, 0); 26_ = Throw.IfLessThan(count, 0); 73Throw.ArgumentException(nameof(obj), $"Provided value must be of type {typeof(StringRange)}, but was of type {obj.GetType()}.");
SystemResources.cs (4)
62GuaranteedCpuUnits = Throw.IfLessThanOrEqual(guaranteedCpuUnits, 0.0); 63MaximumCpuUnits = Throw.IfLessThanOrEqual(maximumCpuUnits, 0.0); 64GuaranteedMemoryInBytes = Throw.IfLessThan(guaranteedMemoryInBytes, 1UL); 65MaximumMemoryInBytes = Throw.IfLessThan(maximumMemoryInBytes, 1UL);