47 instantiations of ResourceMonitoringOptions
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (47)
Linux\LinuxCountersTests.cs (1)
78
var options = Microsoft.Extensions.Options.Options.Create<ResourceMonitoringOptions>(
new
());
Linux\LinuxUtilizationProviderTests.cs (4)
31
var options = Options.Options.Create(new
ResourceMonitoringOptions
());
101
var options = Options.Options.Create<ResourceMonitoringOptions>(
new
());
169
var options = Options.Options.Create<ResourceMonitoringOptions>(
new
());
199
var options = Options.Options.Create<ResourceMonitoringOptions>(
new
());
ResourceMonitoringOptionsCustomValidatorTests.cs (4)
19
var options = new
ResourceMonitoringOptions
33
var options = new
ResourceMonitoringOptions
48
var options = new
ResourceMonitoringOptions
62
var options = new
ResourceMonitoringOptions
ResourceMonitoringOptionsTests.cs (1)
14
var options = new
ResourceMonitoringOptions
ResourceMonitoringOptionsValidatorTests.cs (5)
15
var options = new
ResourceMonitoringOptions
32
var options = new
ResourceMonitoringOptions
47
var options = new
ResourceMonitoringOptions
62
var options = new
ResourceMonitoringOptions
107
var options = new
ResourceMonitoringOptions
ResourceMonitoringServiceTests.cs (18)
52
Create(new
ResourceMonitoringOptions
()),
88
new ResourceMonitorService(mockProvider.Object, mockLogger.Object, Create(new
ResourceMonitoringOptions
()), null!, TimeProvider.System));
111
Create(new
ResourceMonitoringOptions
141
Create(new
ResourceMonitoringOptions
()),
169
Create(new
ResourceMonitoringOptions
201
Create(new
ResourceMonitoringOptions
242
Create(new
ResourceMonitoringOptions
275
Create(new
ResourceMonitoringOptions
316
Create(new
ResourceMonitoringOptions
359
Create(new
ResourceMonitoringOptions
436
var options = new
ResourceMonitoringOptions
545
var options = new
ResourceMonitoringOptions
595
Create(new
ResourceMonitoringOptions
()),
617
Create(new
ResourceMonitoringOptions
()),
652
Create(new
ResourceMonitoringOptions
677
Create(new
ResourceMonitoringOptions
701
Create(new
ResourceMonitoringOptions
721
Microsoft.Extensions.Options.Options.Create(new
ResourceMonitoringOptions
()), Array.Empty<IResourceUtilizationPublisher>(), TimeProvider.System);
Windows\Tcp6TableInfoTests.cs (3)
232
var options = new
ResourceMonitoringOptions
248
var options = new
ResourceMonitoringOptions
266
var options = new
ResourceMonitoringOptions
Windows\TcpTableInfoTests.cs (3)
175
var options = new
ResourceMonitoringOptions
191
var options = new
ResourceMonitoringOptions
209
var options = new
ResourceMonitoringOptions
Windows\WindowsContainerSnapshotProviderTests.cs (3)
219
var options = new
ResourceMonitoringOptions
{ CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
282
var options = new
ResourceMonitoringOptions
{ MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
331
var options = Options.Options.Create<ResourceMonitoringOptions>(
new
());
Windows\WindowsCountersTests.cs (2)
24
var options = new
ResourceMonitoringOptions
66
var options = new
ResourceMonitoringOptions
Windows\WindowsSnapshotProviderTests.cs (3)
33
_options = Options.Options.Create<ResourceMonitoringOptions>(
new
());
79
var options = new
ResourceMonitoringOptions
{ CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
114
var options = new
ResourceMonitoringOptions
{ MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
103 references to ResourceMonitoringOptions
Microsoft.Extensions.Diagnostics.ResourceMonitoring (17)
ResourceMonitoringBuilderExtensions.cs (6)
21
/// <param name="configure">Delegate to configure <see cref="
ResourceMonitoringOptions
"/>.</param>
26
Action<
ResourceMonitoringOptions
> configure)
38
/// <param name="section">The <see cref="IConfigurationSection"/> to use for configuring <see cref="
ResourceMonitoringOptions
"/>.</param>
53
Action<OptionsBuilder<
ResourceMonitoringOptions
>> configure)
56
.Services.AddOptionsWithValidateOnStart<
ResourceMonitoringOptions
, ResourceMonitoringOptionsValidator>()
57
.Services.AddOptionsWithValidateOnStart<
ResourceMonitoringOptions
, ResourceMonitoringOptionsCustomValidator>();
ResourceMonitoringOptionsCustomValidator.cs (2)
10
internal sealed class ResourceMonitoringOptionsCustomValidator : IValidateOptions<
ResourceMonitoringOptions
>
12
public ValidateOptionsResult Validate(string? name,
ResourceMonitoringOptions
options)
ResourceMonitoringOptionsValidator.cs (1)
9
internal sealed partial class ResourceMonitoringOptionsValidator : IValidateOptions<
ResourceMonitoringOptions
>
ResourceMonitorService.cs (3)
57
IOptions<
ResourceMonitoringOptions
> options,
66
IOptions<
ResourceMonitoringOptions
> options,
73
var
optionsValue = Throw.IfMemberNull(options, options.Value);
Windows\Network\WindowsTcpStateInfo.cs (1)
28
public WindowsTcpStateInfo(IOptions<
ResourceMonitoringOptions
> options)
Windows\WindowsContainerSnapshotProvider.cs (2)
51
IOptions<
ResourceMonitoringOptions
> options)
70
ResourceMonitoringOptions
options)
Windows\WindowsSnapshotProvider.cs (2)
39
public WindowsSnapshotProvider(ILogger<WindowsSnapshotProvider>? logger, IMeterFactory meterFactory, IOptions<
ResourceMonitoringOptions
> options)
48
ResourceMonitoringOptions
options,
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (86)
Linux\AcceptanceTest.cs (17)
50
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.CpuConsumptionRefreshInterval)}", cpuRefresh.ToString()),
51
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.MemoryConsumptionRefreshInterval)}", memoryRefresh.ToString()),
57
.GetSection(nameof(
ResourceMonitoringOptions
));
63
var options = services.GetRequiredService<IOptions<
ResourceMonitoringOptions
>>();
85
var options = services.GetRequiredService<IOptions<
ResourceMonitoringOptions
>>();
102
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.CpuConsumptionRefreshInterval)}", cpuRefresh.ToString()),
103
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.MemoryConsumptionRefreshInterval)}", memoryRefresh.ToString()),
109
.GetSection(nameof(
ResourceMonitoringOptions
));
151
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.CpuConsumptionRefreshInterval)}", cpuRefresh.ToString()),
152
new($"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.MemoryConsumptionRefreshInterval)}", memoryRefresh.ToString()),
158
.GetSection(nameof(
ResourceMonitoringOptions
));
Linux\LinuxCountersTests.cs (1)
78
var options = Microsoft.Extensions.Options.Options.Create<
ResourceMonitoringOptions
>(new());
Linux\LinuxUtilizationProviderTests.cs (3)
101
var options = Options.Options.Create<
ResourceMonitoringOptions
>(new());
169
var options = Options.Options.Create<
ResourceMonitoringOptions
>(new());
199
var options = Options.Options.Create<
ResourceMonitoringOptions
>(new());
ResourceMonitoringExtensionsTests.cs (11)
28
Assert.Throws<ArgumentNullException>(() => services.AddResourceMonitoring((b) => b.ConfigureMonitor((Action<
ResourceMonitoringOptions
>)null!)));
104
var options = host.Services.GetService<IOptions<
ResourceMonitoringOptions
>>();
135
var options = host.Services.GetService<IOptions<
ResourceMonitoringOptions
>>();
152
[$"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.CollectionWindow)}"]
154
[$"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.SamplingInterval)}"]
156
[$"{nameof(
ResourceMonitoringOptions
)}:{nameof(
ResourceMonitoringOptions
.PublishingWindow)}"]
162
.GetSection(nameof(
ResourceMonitoringOptions
));
175
var options = host.Services.GetService<IOptions<
ResourceMonitoringOptions
>>();
ResourceMonitoringOptionsCustomValidatorTests.cs (4)
19
var
options = new ResourceMonitoringOptions
33
var
options = new ResourceMonitoringOptions
48
var
options = new ResourceMonitoringOptions
62
var
options = new ResourceMonitoringOptions
ResourceMonitoringOptionsTests.cs (1)
14
var
options = new ResourceMonitoringOptions
ResourceMonitoringOptionsValidatorTests.cs (29)
15
var
options = new ResourceMonitoringOptions
32
var
options = new ResourceMonitoringOptions
47
var
options = new ResourceMonitoringOptions
62
var
options = new ResourceMonitoringOptions
75
[InlineData(-100, 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
76
[InlineData(-1, 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
77
[InlineData(0, -100,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
78
[InlineData(0, -1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
79
[InlineData(0, 0,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
80
[InlineData(0,
ResourceMonitoringOptions
.MinimumSamplingPeriod + 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
81
[InlineData(0, 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
82
[InlineData(1, 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, true)]
83
[InlineData(
ResourceMonitoringOptions
.MinimumSamplingWindow, 1,
ResourceMonitoringOptions
.MinimumSamplingWindow, false)]
84
[InlineData(
ResourceMonitoringOptions
.MinimumSamplingWindow, 100,
ResourceMonitoringOptions
.MinimumSamplingWindow, false)]
86
ResourceMonitoringOptions
.MaximumSamplingWindow - 1,
87
ResourceMonitoringOptions
.MaximumSamplingPeriod - 1,
88
ResourceMonitoringOptions
.MaximumSamplingPeriod - 1,
91
ResourceMonitoringOptions
.MaximumSamplingWindow,
92
ResourceMonitoringOptions
.MaximumSamplingPeriod,
93
ResourceMonitoringOptions
.MaximumSamplingPeriod,
96
ResourceMonitoringOptions
.MinimumSamplingWindow,
97
ResourceMonitoringOptions
.MinimumSamplingPeriod,
101
ResourceMonitoringOptions
.MinimumSamplingWindow,
102
ResourceMonitoringOptions
.MinimumSamplingPeriod,
103
ResourceMonitoringOptions
.MaximumSamplingWindow + 1,
107
var
options = new ResourceMonitoringOptions
ResourceMonitoringServiceTests.cs (5)
74
new ResourceMonitorService(mockProvider.Object, mockLogger.Object, Create((
ResourceMonitoringOptions
)null!), mockPublishers.Object, _clock));
92
/// Construct the object configured with maximum allowed values of <see cref="
ResourceMonitoringOptions
.AveragingWindow"/> and
93
/// <see cref="
ResourceMonitoringOptions
.NumberOfSamples"/>.
436
var
options = new ResourceMonitoringOptions
545
var
options = new ResourceMonitoringOptions
Windows\Tcp6TableInfoTests.cs (3)
232
var
options = new ResourceMonitoringOptions
248
var
options = new ResourceMonitoringOptions
266
var
options = new ResourceMonitoringOptions
Windows\TcpTableInfoTests.cs (3)
175
var
options = new ResourceMonitoringOptions
191
var
options = new ResourceMonitoringOptions
209
var
options = new ResourceMonitoringOptions
Windows\WindowsContainerSnapshotProviderTests.cs (3)
219
var
options = new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
282
var
options = new ResourceMonitoringOptions { MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
331
var options = Options.Options.Create<
ResourceMonitoringOptions
>(new());
Windows\WindowsCountersTests.cs (2)
24
var
options = new ResourceMonitoringOptions
66
var
options = new ResourceMonitoringOptions
Windows\WindowsSnapshotProviderTests.cs (4)
29
private readonly IOptions<
ResourceMonitoringOptions
> _options;
33
_options = Options.Options.Create<
ResourceMonitoringOptions
>(new());
79
var
options = new ResourceMonitoringOptions { CpuConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };
114
var
options = new ResourceMonitoringOptions { MemoryConsumptionRefreshInterval = TimeSpan.FromMilliseconds(2) };