47 references to Throw
Microsoft.Extensions.Diagnostics.ResourceMonitoring (47)
CircularBuffer.cs (1)
17
_ =
Throw
.IfLessThan(size, 1);
ResourceMonitoringBuilderExtensions.cs (4)
28
_ =
Throw
.IfNull(builder);
29
_ =
Throw
.IfNull(configure);
45
_ =
Throw
.IfNull(builder);
46
_ =
Throw
.IfNull(section);
ResourceMonitoringServiceCollectionExtensions.cs (3)
34
_ =
Throw
.IfNull(services);
50
_ =
Throw
.IfNull(services);
51
_ =
Throw
.IfNull(configure);
ResourceMonitorService.cs (3)
73
var optionsValue =
Throw
.IfMemberNull(options, options.Value);
90
_ =
Throw
.IfLessThanOrEqual(window.Ticks, 0);
91
_ =
Throw
.IfGreaterThan(window.Ticks, _collectionWindow.Ticks);
ResourceUtilization.cs (2)
65
CpuUsedPercentage = Math.Min(Hundred,
Throw
.IfLessThan(cpuUsedPercentage / guaranteedCpuUnits, 0.0));
66
MemoryUsedInBytes =
Throw
.IfLessThan(memoryUsedInBytes, 0);
Snapshot.cs (6)
51
_ =
Throw
.IfLessThan(memoryUsageInBytes, 0);
52
_ =
Throw
.IfLessThan(kernelTimeSinceStart.Ticks, 0);
53
_ =
Throw
.IfLessThan(userTimeSinceStart.Ticks, 0);
75
_ =
Throw
.IfLessThan(memoryUsageInBytes, 0);
76
_ =
Throw
.IfLessThan(kernelTimeSinceStart.Ticks, 0);
77
_ =
Throw
.IfLessThan(userTimeSinceStart.Ticks, 0);
src\Shared\BufferWriterPool\BufferWriter.cs (4)
74
_ =
Throw
.IfLessThan(value, 0);
121
_ =
Throw
.IfOutOfRange(count, 0, _buffer.Length - WrittenCount);
182
Throw
.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)
37
MaximumRetainedCapacity =
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 (10)
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);
136
_ =
Throw
.IfLessThan(maxCapacity, 1);
155
_ =
Throw
.IfLessThan(maxCapacity, 1);
177
_ =
Throw
.IfLessThan(maxCapacity, 1);
src\Shared\StringSplit\StringRange.cs (3)
25
_ =
Throw
.IfLessThan(index, 0);
26
_ =
Throw
.IfLessThan(count, 0);
73
Throw
.ArgumentException(nameof(obj), $"Provided value must be of type {typeof(StringRange)}, but was of type {obj.GetType()}.");
SystemResources.cs (4)
57
GuaranteedCpuUnits =
Throw
.IfLessThanOrEqual(guaranteedCpuUnits, 0.0);
58
MaximumCpuUnits =
Throw
.IfLessThanOrEqual(maximumCpuUnits, 0.0);
59
GuaranteedMemoryInBytes =
Throw
.IfLessThan(guaranteedMemoryInBytes, 1UL);
60
MaximumMemoryInBytes =
Throw
.IfLessThan(maximumMemoryInBytes, 1UL);