public static HealthCheckBuilder AddCounterCheck(this HealthCheckBuilder builder, IConfiguration configuration)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

            var options = new CounterCheckOptions();

            configuration.Bind(options);

            return(builder.AddCounterCheck(options));
        }
        public static HealthCheckBuilder AddCounterCheck(this HealthCheckBuilder builder, CounterCheckOptions options)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

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

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

            return(builder.AddCounterCheck(settings));
        }