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