public SearchServiceClient(
     IAzureManagementAPIWrapper azureManagementApiWrapper,
     IHttpClientWrapper httpClient,
     IOptionsSnapshot <SearchServiceConfiguration> configuration,
     ILogger <SearchServiceClient> logger)
 {
     _azureManagementApiWrapper = azureManagementApiWrapper;
     _httpClient    = httpClient;
     _configuration = configuration;
     _logger        = logger;
 }
Пример #2
0
        public override void Init(IServiceContainer serviceContainer, IDictionary <string, string> jobArgsDictionary)
        {
            var configurationFilename = JobConfigurationManager.GetArgument(jobArgsDictionary, ConfigurationArgument);

            _serviceProvider = GetServiceProvider(GetConfigurationRoot(configurationFilename));

            _configuration             = _serviceProvider.GetService <PackageLagMonitorConfiguration>();
            _azureManagementApiWrapper = _serviceProvider.GetService <IAzureManagementAPIWrapper>();
            _catalogClient             = _serviceProvider.GetService <ICatalogClient>();
            _httpClient          = _serviceProvider.GetService <IHttpClientWrapper>();
            _searchServiceClient = _serviceProvider.GetService <ISearchServiceClient>();

            _telemetryService = _serviceProvider.GetService <IPackageLagTelemetryService>();
        }
Пример #3
0
 public SearchInstanceRebooter(
     IFeedClient feedClient,
     ISearchServiceClient searchServiceClient,
     IAzureManagementAPIWrapper azureManagementAPIWrapper,
     ITelemetryService telemetryService,
     IOptionsSnapshot <MonitorConfiguration> configuration,
     ILogger <SearchInstanceRebooter> logger)
 {
     _feedClient                = feedClient ?? throw new ArgumentNullException(nameof(feedClient));
     _searchServiceClient       = searchServiceClient ?? throw new ArgumentNullException(nameof(searchServiceClient));
     _azureManagementAPIWrapper = azureManagementAPIWrapper ?? throw new ArgumentNullException(nameof(azureManagementAPIWrapper));
     _telemetryService          = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
     _configuration             = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     _healthyThreshold   = TimeSpan.FromSeconds(_configuration.Value.HealthyThresholdInSeconds);
     _unhealthyThreshold = TimeSpan.FromSeconds(_configuration.Value.UnhealthyThresholdInSeconds);
 }
Пример #4
0
 public RetryingAzureManagementAPIWrapper(IAzureManagementAPIWrapper inner, TimeSpan sleepDuration)
 {
     _inner         = inner ?? throw new ArgumentNullException(nameof(inner));
     _sleepDuration = sleepDuration;
 }