public PollingAddressSelector(IServiceRouteManager serviceRouteManager, IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
     //路由发生变更时重建地址条目。
     serviceRouteManager.Changed += ServiceRouteManager_Removed;
     serviceRouteManager.Removed += ServiceRouteManager_Removed;
 }
Beispiel #2
0
 public RemoteInvokeService(IAddressResolver addressResolver, ITransportClientFactory transportClientFactory, ILogger<RemoteInvokeService> logger, IHealthCheckService healthCheckService)
 {
     _addressResolver = addressResolver;
     _transportClientFactory = transportClientFactory;
     _logger = logger;
     _healthCheckService = healthCheckService;
 }
 public DefaultAddressResolver(IServiceRouteManager serviceRouteManager, ILogger<DefaultAddressResolver> logger, IAddressSelector addressSelector, IHealthCheckService healthCheckService)
 {
     _serviceRouteManager = serviceRouteManager;
     _logger = logger;
     _addressSelector = addressSelector;
     _healthCheckService = healthCheckService;
 }
Beispiel #4
0
 public DbHealthCheckUseCase(IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
 }
Beispiel #5
0
 public DefaultMqttBrokerEntryManager(IMqttServiceRouteManager mqttServiceRouteManager,
                                      ILogger <DefaultMqttBrokerEntryManager> logger, IHealthCheckService healthCheckService)
 {
     _mqttServiceRouteManager = mqttServiceRouteManager;
     _logger = logger;
     _mqttServiceRouteManager.Changed += MqttRouteManager_Removed;
     _mqttServiceRouteManager.Removed += MqttRouteManager_Removed;
     healthCheckService.Removed       += MqttRouteManager_Removed;
 }
 public ThriftTransportClientFactory(ITransportMessageCodecFactory codecFactory, IHealthCheckService healthCheckService, ILogger <ThriftTransportClientFactory> logger, IServiceExecutor serviceExecutor)
 {
     _transportMessageEncoder = codecFactory.GetEncoder();
     _transportMessageDecoder = codecFactory.GetDecoder();
     _logger             = logger;
     _healthCheckService = healthCheckService;
     _serviceExecutor    = serviceExecutor;
 }
Beispiel #7
0
 public HealthCheckHandler(IHealthCheckConfiguration healthCheckConfiguration, IHealthCheckService healthCheckService) : base(healthCheckConfiguration)
 {
     _hcService = healthCheckService;
     _hcConfig  = healthCheckConfiguration;
 }
Beispiel #8
0
 public DashboardDataHandle(IServiceProvider serviceProvider, IOptions <DashboardOptions> options, IHealthCheckService healthCheckService, IAuthService authService, IHttpReportsStorage storage, IScheduleService scheduleService, ILocalizeService localizeService) : base(serviceProvider)
 {
     _storage            = storage;
     _options            = options.Value;
     _scheduleService    = scheduleService;
     _localizeService    = localizeService;
     _authService        = authService;
     _healthCheckService = healthCheckService;
 }
Beispiel #9
0
        public TradingService(ILoggingService loggingService, INotificationService notificationService, IHealthCheckService healthCheckService)
        {
            this.loggingService      = loggingService;
            this.notificationService = notificationService;
            this.healthCheckService  = healthCheckService;

            this.isReplayingSnapshots = Application.Resolve <IBacktestingService>().Config.Enabled&& Application.Resolve <IBacktestingService>().Config.Replay;

            if (isReplayingSnapshots)
            {
                this.exchangeService = Application.ResolveOptionalNamed <IExchangeService>(Constants.ServiceNames.BacktestingExchangeService);
            }
            else
            {
                this.exchangeService = Application.ResolveOptionalNamed <IExchangeService>(Config.Exchange);
            }

            if (this.exchangeService == null)
            {
                throw new Exception($"Unsupported exchange: {Config.Exchange}");
            }
        }
Beispiel #10
0
        public TradingViewCryptoSignalPollingTimedTask(ILoggingService loggingService, IHealthCheckService healthCheckService,
                                                       ITradingService tradingService, TradingViewCryptoSignalReceiver signalReceiver)
        {
            this.loggingService     = loggingService;
            this.healthCheckService = healthCheckService;
            this.tradingService     = tradingService;
            this.signalReceiver     = signalReceiver;

            this.signalsSerializer = new JsonSerializer();
            this.signalsSerializer.Converters.Add(new TradingViewCryptoSignalConverter());
            this.httpClient = CreateHttpClient();
        }
Beispiel #11
0
 public DotNettyTransportClientFactory(ITransportMessageCodecFactory codecFactory, IHealthCheckService healthCheckService, ILogger <DotNettyTransportClientFactory> logger, IServiceExecutor serviceExecutor)
 {
     _transportMessageEncoder = codecFactory.GetEncoder();
     _transportMessageDecoder = codecFactory.GetDecoder();
     _logger             = logger;
     _healthCheckService = healthCheckService;
     _serviceExecutor    = serviceExecutor;
     _bootstrap          = GetBootstrap();
     _bootstrap.Handler(new ActionChannelInitializer <ISocketChannel>(c =>
     {
         var pipeline = c.Pipeline;
         pipeline.AddLast(new LengthFieldPrepender(4));
         pipeline.AddLast(new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4));
         pipeline.AddLast(new TransportMessageChannelHandlerAdapter(_transportMessageDecoder));
         pipeline.AddLast(new DefaultChannelHandler(this));
     }));
 }
 public DefaultAddressResolver(IServiceCommandProvider commandProvider, IServiceRouteManager serviceRouteManager, ILogger <DefaultAddressResolver> logger, CPlatformContainer container, IHealthCheckService healthCheckService)
 {
     _container           = container;
     _serviceRouteManager = serviceRouteManager;
     _logger = logger;
     LoadAddressSelectors();
     _commandProvider             = commandProvider;
     _healthCheckService          = healthCheckService;
     serviceRouteManager.Changed += ServiceRouteManager_Removed;
     serviceRouteManager.Removed += ServiceRouteManager_Removed;
     serviceRouteManager.Created += ServiceRouteManager_Add;
 }
        public HealthCheckMiddleware(
            RequestDelegate next,
            IOptions <HealthCheckOptions> options,
            ILoggerFactory loggerFactory,
            IHealthCheckService healthService,
            IHealthCheckPolicyProvider policyProvider,
            IAuthorizationService authorizationService)
        {
            if (next == null)
            {
                throw new ArgumentNullException(nameof(next));
            }

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

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

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

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

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

            _next                 = next;
            _options              = options.Value;
            _logger               = loggerFactory.CreateLogger <HealthCheckMiddleware>();
            _healthService        = healthService;
            _policyProvider       = policyProvider;
            _authorizationService = authorizationService;

            _charPool     = ArrayPool <char> .Shared;
            _jsonCharPool = new JsonArrayPool <char>(_charPool);
            _bytePool     = ArrayPool <byte> .Shared;
            JsonSerializerSettings jsonSettings = new JsonSerializerSettings
            {
                ContractResolver = new DefaultContractResolver
                {
                    NamingStrategy = new SnakeCaseNamingStrategy(true, true),
                },
                Converters = new List <JsonConverter>
                {
                    new StringEnumConverter
                    {
                        CamelCaseText = true
                    }
                },
                NullValueHandling = NullValueHandling.Ignore
            };

            _jsonSerializer = JsonSerializer.Create(jsonSettings);
        }
 public HealthCheckController(IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
 }
Beispiel #15
0
 public StatusController(IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
 }
        public static Task <CompositeHealthCheckResult> CheckHealthAsync(this IHealthCheckService service, CheckStatus partiallyHealthyStatus, CancellationToken cancellationToken)
        {
            Guard.ArgumentNotNull(nameof(service), service);

            return(service.CheckHealthAsync(partiallyHealthyStatus, cancellationToken));
        }
        public static Task <CompositeHealthCheckResult> CheckHealthAsync(this IHealthCheckService service)
        {
            Guard.ArgumentNotNull(nameof(service), service);

            return(service.CheckHealthAsync(CheckStatus.Unhealthy, CancellationToken.None));
        }
        public TradingViewCryptoSignalReceiver(string signalName,
                                               IConfigurationSection configuration, ILoggingService loggingService, IHealthCheckService healthCheckService,
                                               ITasksService tasksService, ISignalsService signalsService, ITradingService tradingService)
        {
            this.SignalName = signalName;
            this.Config     = configuration.Get <TradingViewCryptoSignalReceiverConfig>();

            this.loggingService     = loggingService;
            this.healthCheckService = healthCheckService;
            this.tasksService       = tasksService;
            this.signalsService     = signalsService;
            this.tradingService     = tradingService;
        }
Beispiel #19
0
 public HomeController(IHealthCheckService checkSvc)
 {
     _healthCheckSvc = checkSvc;
 }
Beispiel #20
0
 public RemoteServiceInvoker(IRpcClientFactory factory, IAddressResolver addressResolver, IHealthCheckService healthCheckService, ILogger <RemoteServiceInvoker> logger)
 {
     this._logger             = logger;
     this._clientFactory      = factory;
     this._healthCheckService = healthCheckService;
     this._addressResolver    = addressResolver;
 }
Beispiel #21
0
 public ExchangeService(ILoggingService loggingService, IHealthCheckService healthCheckService, ITasksService tasksService)
 {
     this.loggingService     = loggingService;
     this.healthCheckService = healthCheckService;
     this.tasksService       = tasksService;
 }
 public DefaultChannelHandler(DotNettyTransportClientFactory factory,
                              IHealthCheckService healthCheckService)
 {
     _factory            = factory;
     _healthCheckService = healthCheckService;
 }
 public ThriftTransportClientFactory(ITransportMessageCodecFactory codecFactory, IHealthCheckService healthCheckService, ILogger <ThriftTransportClientFactory> logger)
     : this(codecFactory, healthCheckService, logger, null)
 {
 }
 public TradingRulesTimedTask(ILoggingService loggingService, INotificationService notificationService, IHealthCheckService healthCheckService, IRulesService rulesService, ISignalsService signalsService, ITradingService tradingService)
 {
     this.loggingService      = loggingService;
     this.notificationService = notificationService;
     this.healthCheckService  = healthCheckService;
     this.rulesService        = rulesService;
     this.signalsService      = signalsService;
     this.tradingService      = tradingService as TradingService;
 }
 public DefaultAddressResolver(IServiceRouteManager serviceRouteManager, ILogger <DefaultAddressResolver> logger, CPlatformContainer container, IHealthCheckService healthCheckService)
 {
     _container           = container;
     _serviceRouteManager = serviceRouteManager;
     _logger                      = logger;
     _addressSelector             = container.GetInstances <IAddressSelector>(AppConfig.LoadBalanceMode.ToString());
     _healthCheckService          = healthCheckService;
     serviceRouteManager.Changed += ServiceRouteManager_Removed;
     serviceRouteManager.Removed += ServiceRouteManager_Removed;
     serviceRouteManager.Created += ServiceRouteManager_Add;
 }
 public ServerHandler(Action <IChannelHandlerContext, TransportMessage> readAction, ILogger logger)
 {
     _readAction         = readAction;
     _logger             = logger;
     _healthCheckService = ServiceLocator.GetService <IHealthCheckService>();
 }
 public HealthCheckController(IHealthCheckService healthCheck)
 {
     _service = healthCheck;
 }
 public HealthCheckTimedTask(ILoggingService loggingService, INotificationService notificationService, IHealthCheckService healthCheckService, ICoreService coreService, ITradingService tradingService)
 {
     this.loggingService      = loggingService;
     this.notificationService = notificationService;
     this.healthCheckService  = healthCheckService;
     this.coreService         = coreService;
     this.tradingService      = tradingService;
 }
 public HashAlgorithmAdrSelector(IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
 }
 public HomeController(IHealthCheckService healthCheck)
 {
     _healthCheck = healthCheck;
 }
Beispiel #31
0
 public HealthModule(IBroadcastSignalRMessage signalRBroadcaster, IHealthCheckService healthCheckService)
     : base(signalRBroadcaster)
 {
     _healthCheckService = healthCheckService;
     GetResourceAll      = GetHealth;
 }
Beispiel #32
0
 public RemoteInvokeService(IHashAlgorithm hashAlgorithm, IAddressResolver addressResolver, ITransportClientFactory transportClientFactory, ILogger <RemoteInvokeService> logger, IHealthCheckService healthCheckService)
 {
     _addressResolver        = addressResolver;
     _transportClientFactory = transportClientFactory;
     _logger             = logger;
     _healthCheckService = healthCheckService;
 }
Beispiel #33
0
 public HealthCheckController(IHealthCheckService healthCheckService)
 {
     _healthCheckService = healthCheckService;
 }
Beispiel #34
0
 public AccountTimedTask(ILoggingService loggingService, IHealthCheckService healthCheckService, ITradingService tradingService)
 {
     this.loggingService     = loggingService;
     this.healthCheckService = healthCheckService;
     this.tradingService     = tradingService;
 }