Example #1
0
 /// <summary>
 ///     RMS监控
 /// </summary>
 /// <param name="options"></param>
 /// <param name="clientFactory"></param>
 public Rms(RmsOptions options, IHttpClientFactory clientFactory)
 {
     _options       = options ?? throw new ArgumentNullException(nameof(options));
     _clientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
 }
Example #2
0
 /// <summary>
 /// 注入RMS告警服务
 /// </summary>
 /// <param name="serviceCollection"></param>
 /// <param name="options"></param>
 /// <param name="clientFactory"></param>
 /// <returns></returns>
 public static IServiceCollection AddRms(this IServiceCollection serviceCollection, RmsOptions options,
                                         IHttpClientFactory clientFactory)
 {
     serviceCollection.AddSingleton(options);
     serviceCollection.AddSingleton(new Rms(options, clientFactory));
     return(serviceCollection);
 }