public Alarms( AppConfig config, IStorageClient storageClient, ILogger <Alarms> logger, IHttpContextAccessor contextAccessor, IAppConfigurationClient appConfigurationClient, IKustoQueryClient kustoQueryClient) { this.storageClient = storageClient; this.databaseName = config.DeviceTelemetryService.Alarms.Database; this.logger = logger; this.maxDeleteRetryCount = config.DeviceTelemetryService.Alarms.MaxDeleteRetries; this.httpContextAccessor = contextAccessor; this.appConfigurationClient = appConfigurationClient; this.kustoQueryClient = kustoQueryClient; this.kustoEnabled = config.DeviceTelemetryService.Messages.TelemetryStorageType.Equals( TelemetryStorageTypeConstants.Ade, StringComparison.OrdinalIgnoreCase); }
public Messages( AppConfig config, IStorageClient storageClient, ITimeSeriesClient timeSeriesClient, IKustoQueryClient kustoQueryClient, ILogger <Messages> logger, IHttpContextAccessor contextAccessor, IAppConfigurationClient appConfigurationClient) { this.storageClient = storageClient; this.timeSeriesClient = timeSeriesClient; this.kustoQueryClient = kustoQueryClient; this.timeSeriesEnabled = config.DeviceTelemetryService.Messages.TelemetryStorageType.Equals( TsiStorageTypeKey, StringComparison.OrdinalIgnoreCase); this.documentClient = storageClient.GetDocumentClient(); this.databaseName = config.DeviceTelemetryService.Messages.Database; this.logger = logger; this.config = config; this.httpContextAccessor = contextAccessor; this.appConfigurationClient = appConfigurationClient; }
public KustoQueryClientTest() { this.mockILogger = new Mock <ILogger <KustoQueryClient> >(); this.mockKustoQueryClient = new Mock <ICslQueryProvider>(); this.rand = new Random(); this.mockConfig = new Mock <AppConfig>(); this.mockConfig .Setup(x => x.Global.AzureActiveDirectory.AppId) .Returns(this.rand.NextString()); this.mockConfig .Setup(x => x.Global.AzureActiveDirectory.AppSecret) .Returns(this.rand.NextString()); this.mockConfig .Setup(x => x.Global.AzureActiveDirectory.TenantId) .Returns(this.rand.NextString()); this.client = new KustoQueryClient( this.mockConfig.Object, this.mockILogger.Object, this.mockKustoQueryClient.Object); }
public Devices( AppConfig config, ITenantConnectionHelper tenantConnectionHelper, IAsaManagerClient asaManagerClient, IDeviceQueryCache deviceQueryCache, IStorageClient storageClient, IAppConfigurationClient appConfigurationClient, IKustoQueryClient kustoQueryClient) { if (config == null) { throw new ArgumentNullException("config"); } this.kustoEnabled = config.DeviceTelemetryService.Messages.TelemetryStorageType.Equals( TelemetryStorageTypeConstants.Ade, StringComparison.OrdinalIgnoreCase); this.kustoQueryClient = kustoQueryClient; this.tenantConnectionHelper = tenantConnectionHelper; this.asaManager = asaManagerClient; this.deviceQueryCache = deviceQueryCache; this.storageClient = storageClient; this.appConfigurationClient = appConfigurationClient; }