Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ static AggregationTemporalitySelector alwaysCumulative() {
*
* <p>{@link AggregationTemporality#DELTA} is returned for {@link InstrumentType#COUNTER}, {@link
* InstrumentType#OBSERVABLE_COUNTER}, and {@link InstrumentType#HISTOGRAM}. {@link
* AggregationTemporality#CUMULATIVE} is returned for {@link InstrumentType#UP_DOWN_COUNTER} and
* {@link InstrumentType#OBSERVABLE_UP_DOWN_COUNTER}.
* AggregationTemporality#CUMULATIVE} is returned for {@link InstrumentType#UP_DOWN_COUNTER},
* {@link InstrumentType#OBSERVABLE_UP_DOWN_COUNTER} and {@link InstrumentType#GAUGE}.
*/
static AggregationTemporalitySelector deltaPreferred() {
return instrumentType -> {
switch (instrumentType) {
case UP_DOWN_COUNTER:
case OBSERVABLE_UP_DOWN_COUNTER:
case GAUGE:
return AggregationTemporality.CUMULATIVE;
case COUNTER:
case OBSERVABLE_COUNTER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void deltaPreferred() {
assertThat(selector.getAggregationTemporality(InstrumentType.OBSERVABLE_UP_DOWN_COUNTER))
.isEqualTo(AggregationTemporality.CUMULATIVE);
assertThat(selector.getAggregationTemporality(InstrumentType.GAUGE))
.isEqualTo(AggregationTemporality.DELTA);
.isEqualTo(AggregationTemporality.CUMULATIVE);
}

@Test
Expand Down Expand Up @@ -96,6 +96,17 @@ void stringRepresentation() {
+ "OBSERVABLE_COUNTER=DELTA, "
+ "OBSERVABLE_UP_DOWN_COUNTER=CUMULATIVE, "
+ "OBSERVABLE_GAUGE=DELTA, "
+ "GAUGE=CUMULATIVE"
+ "}");
assertThat(AggregationTemporalitySelector.asString(AggregationTemporalitySelector.lowMemory()))
.isEqualTo(
"AggregationTemporalitySelector{"
+ "COUNTER=DELTA, "
+ "UP_DOWN_COUNTER=CUMULATIVE, "
+ "HISTOGRAM=DELTA, "
+ "OBSERVABLE_COUNTER=CUMULATIVE, "
+ "OBSERVABLE_UP_DOWN_COUNTER=CUMULATIVE, "
+ "OBSERVABLE_GAUGE=DELTA, "
+ "GAUGE=DELTA"
+ "}");
}
Expand Down
Loading