Skip to content

Commit 03efcb5

Browse files
committed
review comments
1 parent 8f60276 commit 03efcb5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sdk/src/metrics/state/temporal_metric_storage.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ bool TemporalMetricStorage::buildMetrics(CollectorHandle *collector,
5151
AggregationTemporality aggregation_temporarily =
5252
collector->GetAggregationTemporality(instrument_descriptor_.type_);
5353

54+
// If no metrics, early return
55+
if (delta_metrics->Size() == 0)
56+
{
57+
return true;
58+
}
59+
5460
// Fast path for single collector with delta temporality and counter, updown-counter, histogram
55-
if (collectors.size() == 1 && collector->GetAggregationTemporality(
56-
instrument_descriptor_.type_) == AggregationTemporality::kDelta)
61+
if (collectors.size() == 1 && aggregation_temporarily == AggregationTemporality::kDelta)
5762
{
58-
// If no metrics, early return
59-
if (delta_metrics->Size() == 0)
60-
{
61-
return true;
62-
}
6363

6464
// Create MetricData directly
6565
MetricData metric_data;

0 commit comments

Comments
 (0)