zhaolei
2020-11-20 921de2254ff5712a44ed8575ee8efe34252f6603
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Bootstrap.Security.Mvc.HealthChecks;
 
namespace Microsoft.Extensions.DependencyInjection
{
    /// <summary>
    /// 健康检查扩展类
    /// </summary>
    public static class HealthChecksExtensions
    {
        /// <summary>
        /// 添加 BootstrapAdmin 健康检查
        /// </summary>
        /// <param name="builder"></param>
        /// <returns></returns>
        public static IHealthChecksBuilder AddBootstrapAdminHealthChecks(this IHealthChecksBuilder builder)
        {
#if NETCore
            builder.AddCheck<EnvironmentCheck>("environment");
#endif
            builder.AddCheck<NetCoreRuntimeCheck>("dotnet-runtime");
            builder.AddCheck<GCHealthCheck>("gc");
            builder.AddCheck<MemoryHealthCheck>("mem");
            return builder;
        }
    }
}