예제 #1
0
 public MetricAggregator(
     IMetricScope metricScope,
     IBucketKeyProvider bucketKeyProvider,
     IAirlockClient airlockClient,
     TimeSpan cooldownPeriod,
     Borders borders,
     string eventsRoutingKey)
 {
     aggregatorMetrics = new AggregatorMetrics(metricScope.WithTags(new Dictionary <string, string>
     {
         { MetricsTagNames.Type, "aggregation" }, { "routingKey", eventsRoutingKey }
     }));
     this.bucketKeyProvider = bucketKeyProvider;
     this.airlockClient     = airlockClient;
     this.cooldownPeriod    = cooldownPeriod;
     this.borders           = borders;
     metricsRoutingKey      = RoutingKey.ReplaceSuffix(eventsRoutingKey, RoutingKey.MetricsSuffix);
     buckets = new ConcurrentDictionary <BucketKey, IBucket>();
 }
 public void ReplaceSuffixTest(string key, string[] newSuffix, string newKey)
 {
     Assert.AreEqual(newKey, RoutingKey.ReplaceSuffix(key, newSuffix));
 }