static Func <dynamic, CancellationToken, Task <dynamic> > CreateQuery(ProcessingTimeStore processingTimeStore, EndpointRegistry endpointRegistry) { var criticalTimeStore = new CriticalTimeStore(); var retriesStore = new RetriesStore(); var queueLengthStore = new QueueLengthStore(); var settings = new Settings { EndpointUptimeGracePeriod = TimeSpan.FromMinutes(5) }; var activityTracker = new EndpointInstanceActivityTracker(settings); var messageTypeRegistry = new MessageTypeRegistry(); var breakdownProviders = new IProvideBreakdown[] { processingTimeStore, criticalTimeStore, retriesStore, queueLengthStore }; var monitoredEndpointsModule = new MonitoredEndpointsModule(breakdownProviders, endpointRegistry, activityTracker, messageTypeRegistry) { Context = new NancyContext() { Request = new Request("Get", "/monitored-endpoints/{endpointName}", "HTTP") } }; var queryAction = monitoredEndpointsModule.Routes.Single(r => r.Description.Path == "/monitored-endpoints/{endpointName}").Action; return(queryAction); }
static DiagramApiController CreateConroller(ProcessingTimeStore processingTimeStore, EndpointRegistry endpointRegistry) { var criticalTimeStore = new CriticalTimeStore(); var retriesStore = new RetriesStore(); var queueLengthStore = new QueueLengthStore(); var settings = new Settings { EndpointUptimeGracePeriod = TimeSpan.FromMinutes(5) }; var activityTracker = new EndpointInstanceActivityTracker(settings); var messageTypeRegistry = new MessageTypeRegistry(); var breakdownProviders = new IProvideBreakdown[] { processingTimeStore, criticalTimeStore, retriesStore, queueLengthStore }; var controller = new DiagramApiController(breakdownProviders, endpointRegistry, activityTracker, messageTypeRegistry) { Request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/monitored-endpoint") }; return(controller); }
public new void Setup() { endpointRegistry = new EndpointRegistry(); criticalTimeStore = new CriticalTimeStore(); processingTimeStore = new ProcessingTimeStore(); retriesStore = new RetriesStore(); queueLengthProvider = new FakeQueueLengthProvider(); queueLengthStore = new QueueLengthStore(); queueLengthProvider.Initialize(string.Empty, (entryDtos, dto) => queueLengthStore.Store(entryDtos.Select(e => ToEntry(e)).ToArray(), ToEndpointInputQueue(dto))); var settings = new Settings { EndpointUptimeGracePeriod = TimeSpan.FromMinutes(5) }; activityTracker = new EndpointInstanceActivityTracker(settings); messageTypeRegistry = new MessageTypeRegistry(); var breakdownProviders = new IProvideBreakdown[] { criticalTimeStore, processingTimeStore, retriesStore, queueLengthStore }; var controller = new DiagramApiController(breakdownProviders, endpointRegistry, activityTracker, messageTypeRegistry) { Request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/monitored-endpoint") }; GetMonitoredEndpoints = () => controller.GetAllEndpointsMetrics(); GetMonitoredSingleEndpoint = endpointName => controller.GetSingleEndpointMetrics(endpointName); }
public void Initialize(string connectionString, QueueLengthStore store) { this.connectionString = connectionString.RemoveCustomSchemaPart(out var customSchema); defaultSchema = customSchema ?? "dbo"; this.store = store; }
public void Setup() { endpointRegistry = new EndpointRegistry(); criticalTimeStore = new CriticalTimeStore(); processingTimeStore = new ProcessingTimeStore(); retriesStore = new RetriesStore(); queueLengthProvider = new DefaultQueueLengthProvider(); queueLengthStore = new QueueLengthStore(); queueLengthProvider.Initialize(string.Empty, queueLengthStore); var settings = new Settings { EndpointUptimeGracePeriod = TimeSpan.FromMinutes(5) }; activityTracker = new EndpointInstanceActivityTracker(settings); messageTypeRegistry = new MessageTypeRegistry(); var breakdownProviders = new IProvideBreakdown[] { criticalTimeStore, processingTimeStore, retriesStore, queueLengthStore }; var monitoredEndpointsModule = new MonitoredEndpointsModule(breakdownProviders, endpointRegistry, activityTracker, messageTypeRegistry) { Context = new NancyContext() { Request = new Request("Get", "/monitored-endpoints", "HTTP") } }; var dictionary = monitoredEndpointsModule.Routes.ToDictionary(r => r.Description.Path, r => r.Action); GetMonitoredEndpoints = () => dictionary["/monitored-endpoints"](new object(), new CancellationToken(false)); GetMonitoredSingleEndpoint = endpointName => dictionary["/monitored-endpoints/{endpointName}"](new { EndpointName = endpointName }.ToDynamic(), new CancellationToken()); }
public void Initialize(string connectionString, QueueLengthStore store) { var builder = new DbConnectionStringBuilder { ConnectionString = connectionString }; if (builder.ContainsKey("AccessKeyId") || builder.ContainsKey("SecretAccessKey")) { // if the user provided the access key and secret access key they should always be loaded from environment credentials clientFactory = () => new AmazonSQSClient(new EnvironmentVariablesAWSCredentials()); } else { //See https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-creds.html#creds-assign Logger.Info("BasicAWSCredentials have not been supplied in the connection string. Attempting to use existing environment or IAM role credentials."); } if (builder.TryGetValue("QueueNamePrefix", out var prefix)) { queueNamePrefix = (string)prefix; } this.store = store; }
public void Initialize(string connectionString, QueueLengthStore store) { rootFolder = Path.Combine(connectionString, ".learningtransport"); queueLengthStore = store; }
public void Initialize(string connectionString, QueueLengthStore store) { this.connectionString = connectionString; this.store = store; }
public void Initialize(string connectionString, QueueLengthStore store) { this.queueLengthStore = store; this.managementClient = new ManagementClient(connectionString); }
public void Initialize(string connectionString, QueueLengthStore store) { this.queueLengthStore = store; this.namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString); }
public void Initialize(string connectionString, QueueLengthStore store) { queryExecutor = new QueryExecutor(connectionString); this.store = store; }