Minor refactoring (#2987)
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
This commit is contained in:
parent
6973a539d3
commit
abea4b60f6
|
|
@ -33,7 +33,6 @@ namespace OpenTelemetry.Metrics
|
|||
private readonly ConcurrentDictionary<Tags, int> tagsToMetricPointIndexDictionary =
|
||||
new ConcurrentDictionary<Tags, int>();
|
||||
|
||||
private readonly AggregationTemporality temporality;
|
||||
private readonly string name;
|
||||
private readonly string metricPointCapHitMessage;
|
||||
private readonly bool outputDelta;
|
||||
|
|
@ -65,8 +64,7 @@ namespace OpenTelemetry.Metrics
|
|||
this.metricPoints = new MetricPoint[maxMetricPoints];
|
||||
this.currentMetricPointBatch = new int[maxMetricPoints];
|
||||
this.aggType = aggType;
|
||||
this.temporality = temporality;
|
||||
this.outputDelta = temporality == AggregationTemporality.Delta ? true : false;
|
||||
this.outputDelta = temporality == AggregationTemporality.Delta;
|
||||
this.histogramBounds = histogramBounds;
|
||||
this.startTimeExclusive = DateTimeOffset.UtcNow;
|
||||
if (tagKeysInteresting == null)
|
||||
|
|
@ -102,7 +100,7 @@ namespace OpenTelemetry.Metrics
|
|||
{
|
||||
this.batchSize = 0;
|
||||
var indexSnapshot = Math.Min(this.metricPointIndex, this.maxMetricPoints - 1);
|
||||
if (this.temporality == AggregationTemporality.Delta)
|
||||
if (this.outputDelta)
|
||||
{
|
||||
this.SnapshotDelta(indexSnapshot);
|
||||
}
|
||||
|
|
@ -125,7 +123,7 @@ namespace OpenTelemetry.Metrics
|
|||
continue;
|
||||
}
|
||||
|
||||
metricPoint.TakeSnapshot(this.outputDelta);
|
||||
metricPoint.TakeSnapshot(outputDelta: true);
|
||||
this.currentMetricPointBatch[this.batchSize] = i;
|
||||
this.batchSize++;
|
||||
}
|
||||
|
|
@ -146,7 +144,7 @@ namespace OpenTelemetry.Metrics
|
|||
continue;
|
||||
}
|
||||
|
||||
metricPoint.TakeSnapshot(this.outputDelta);
|
||||
metricPoint.TakeSnapshot(outputDelta: false);
|
||||
this.currentMetricPointBatch[this.batchSize] = i;
|
||||
this.batchSize++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,14 +111,14 @@ namespace OpenTelemetry.Metrics
|
|||
|
||||
private void ExporterProc()
|
||||
{
|
||||
var sw = Stopwatch.StartNew();
|
||||
int index;
|
||||
int timeout;
|
||||
var triggers = new WaitHandle[] { this.exportTrigger, this.shutdownTrigger };
|
||||
var sw = Stopwatch.StartNew();
|
||||
|
||||
while (true)
|
||||
{
|
||||
var timeout = (int)(this.exportIntervalMilliseconds - (sw.ElapsedMilliseconds % this.exportIntervalMilliseconds));
|
||||
|
||||
int index;
|
||||
timeout = (int)(this.exportIntervalMilliseconds - (sw.ElapsedMilliseconds % this.exportIntervalMilliseconds));
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Metrics;
|
||||
using System.Threading;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using OpenTelemetry;
|
||||
using OpenTelemetry.Metrics;
|
||||
|
|
|
|||
Loading…
Reference in New Issue