예제 #1
0
        public static HealthCheckBuilder AddVirtualMemorySizeCheck(this HealthCheckBuilder builder, ThresholdCheckOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            var settings = new FloorThresholdCheckSettings(options.Name, options.Critical, options.Frequency, options.Tags, options.ErrorThreshold, options.WarningThreshold);

            return(builder.AddVirtualMemorySizeCheck(settings));
        }
예제 #2
0
        public static HealthCheckBuilder AddVirtualMemorySizeCheck(this HealthCheckBuilder builder, IConfiguration configuration)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var options = new ThresholdCheckOptions();

            configuration.Bind(options);

            return(builder.AddVirtualMemorySizeCheck(options));
        }
예제 #3
0
        public static HealthCheckBuilder AddVirtualMemorySizeCheck(this HealthCheckBuilder builder, string name, Action <VirtualMemorySizeCheckSettingsBuilder> configureAction)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (configureAction == null)
            {
                throw new ArgumentNullException(nameof(configureAction));
            }

            var settingsBuilder = new VirtualMemorySizeCheckSettingsBuilder(name);

            configureAction(settingsBuilder);
            var settings = settingsBuilder.Build();

            return(builder.AddVirtualMemorySizeCheck(settings));
        }