internal AggregatorStore( AggregationType aggType, AggregationTemporality temporality, double[] histogramBounds, string[] tagKeysInteresting = null) { this.metricPoints = new MetricPoint[MaxMetricPoints]; this.aggType = aggType; this.temporality = temporality; this.outputDelta = temporality == AggregationTemporality.Delta ? true : false; this.histogramBounds = histogramBounds; this.startTimeExclusive = DateTimeOffset.UtcNow; if (tagKeysInteresting == null) { this.updateLongCallback = this.UpdateLong; this.updateDoubleCallback = this.UpdateDouble; } else { this.updateLongCallback = this.UpdateLongCustomTags; this.updateDoubleCallback = this.UpdateDoubleCustomTags; var hs = new HashSet <string>(StringComparer.Ordinal); foreach (var key in tagKeysInteresting) { hs.Add(key); } this.tagKeysInteresting = hs; this.tagsKeysInterestingCount = hs.Count; } }
internal AggregatorStore( string name, AggregationType aggType, AggregationTemporality temporality, int maxMetricPoints, double[] histogramBounds, string[] tagKeysInteresting = null) { this.name = name; this.maxMetricPoints = maxMetricPoints; this.metricPointCapHitMessage = $"Maximum MetricPoints limit reached for this Metric stream. Configured limit: {this.maxMetricPoints}"; this.metricPoints = new MetricPoint[maxMetricPoints]; this.currentMetricPointBatch = new int[maxMetricPoints]; this.aggType = aggType; this.temporality = temporality; this.outputDelta = temporality == AggregationTemporality.Delta ? true : false; this.histogramBounds = histogramBounds; this.startTimeExclusive = DateTimeOffset.UtcNow; if (tagKeysInteresting == null) { this.updateLongCallback = this.UpdateLong; this.updateDoubleCallback = this.UpdateDouble; } else { this.updateLongCallback = this.UpdateLongCustomTags; this.updateDoubleCallback = this.UpdateDoubleCustomTags; var hs = new HashSet <string>(tagKeysInteresting, StringComparer.Ordinal); this.tagKeysInteresting = hs; this.tagsKeysInterestingCount = hs.Count; } }