public MicroserviceDefinitionBuilderTests()
 {
     _logger            = Substitute.For <IAlleyLogger>();
     _descriptor        = Substitute.For <IMicroserviceDescriptor>();
     _textReaderFactory = Substitute.For <ITextReaderFactory>();
     _sut = new MicroserviceDefinitionBuilder(_descriptor, _textReaderFactory, _logger);
 }
Пример #2
0
 private static void HandleIfError(IResult result, StatusCode statusCode, IAlleyLogger logger)
 {
     if (result.IsFailure)
     {
         logger.Error(result.Message);
         throw new RpcException(new Status(statusCode, result.Message));
     }
 }
Пример #3
0
 public MicroserviceDefinitionBuilder(
     IMicroserviceDescriptor microserviceDescriptor,
     ITextReaderFactory textReaderFactory,
     IAlleyLogger logger)
 {
     _microserviceDescriptor = microserviceDescriptor;
     _textReaderFactory      = textReaderFactory;
     _logger = logger;
 }
Пример #4
0
 public MonitoringDirector(
     IHealthRegistration healthRegistration,
     IMetricsRegistration metricsRegistration,
     IAlleyLogger logger)
 {
     _healthRegistration  = healthRegistration;
     _metricsRegistration = metricsRegistration;
     _logger = logger;
 }
Пример #5
0
 public CpuUsageFetcher(
     HttpClient httpClient,
     IConfigurationProvider configurationProvider,
     IAlleyLogger logger) :
     base(
         httpClient,
         configurationProvider.CpuUsageQuery,
         logger)
 {
 }
Пример #6
0
 public MicroserviceContext(
     IMicroserviceInstanceFactory microserviceInstanceFactory,
     IAlleyLogger logger) : this(
         new ConcurrentDictionary <string, IMicroservice>(),
         new ConcurrentDictionary <string, IMicroservice>(),
         new ConcurrentDictionary <Uri, IMicroserviceInstance>(),
         microserviceInstanceFactory,
         logger)
 {
 }
Пример #7
0
 public HealthFetcher(
     HttpClient httpClient,
     IConfigurationProvider configurationProvider,
     IAlleyLogger logger) :
     base(
         httpClient,
         configurationProvider.HealthCheckQuery,
         logger)
 {
 }
Пример #8
0
 public ConnectionSession(ChannelBase channel,
                          Method <TRequest, TResponse> method,
                          IMetricRepository metricRepository,
                          IConfigurationProvider configurationProvider,
                          IAlleyLogger logger)
 {
     _channel               = channel;
     _method                = method;
     _metricRepository      = metricRepository;
     _configurationProvider = configurationProvider;
     _logger                = logger;
     _target                = FormatTarget(_channel.Target);
 }
Пример #9
0
 public MicroserviceContext(
     IDictionary <string, IMicroservice> servicesOwners,
     IDictionary <string, IMicroservice> microservices,
     IDictionary <Uri, IMicroserviceInstance> instances,
     IMicroserviceInstanceFactory microserviceInstanceFactory,
     IAlleyLogger logger)
 {
     _servicesOwners = servicesOwners;
     _microservices  = microservices;
     _instances      = instances;
     _microserviceInstanceFactory = microserviceInstanceFactory;
     _logger = logger;
 }
Пример #10
0
 public SessionFactory(
     IConnectionTargetProvider connectionTargetProvider,
     IMethodFactory <TRequest, TResponse> methodFactory,
     IMetricRepository metricRepository,
     IChannelProvider channelProvider,
     IConfigurationProvider configurationProvider,
     IAlleyLogger logger)
 {
     _connectionTargetProvider = connectionTargetProvider;
     _configurationProvider    = configurationProvider;
     _methodFactory            = methodFactory;
     _metricRepository         = metricRepository;
     _channelProvider          = channelProvider;
     _logger = logger;
 }
Пример #11
0
        public MicroserviceContextTests()
        {
            _logger = Substitute.For <IAlleyLogger>();
            _microserviceInstanceFactory = Substitute.For <IMicroserviceInstanceFactory>();

            _servicesOwners = Substitute.For <IDictionary <string, IMicroservice> >();
            _microservices  = Substitute.For <IDictionary <string, IMicroservice> >();
            _instances      = Substitute.For <IDictionary <Uri, IMicroserviceInstance> >();
            _sut            = new MicroserviceContext(
                _servicesOwners,
                _microservices,
                _instances,
                _microserviceInstanceFactory,
                _logger);
        }
Пример #12
0
 public static void HandleIfError(IResult result, IAlleyLogger logger) => HandleIfError(result, StatusCode.Cancelled, logger);
Пример #13
0
 protected MetricFetcherBase(HttpClient httpClient, string query, IAlleyLogger logger)
 {
     _httpClient = httpClient;
     _query      = query;
     _logger     = logger;
 }