Skip to content

Commit

Permalink
Merge branch '1.11.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Sep 20, 2023
2 parents 419ad0c + 22a2993 commit a9edff2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ Stream<String> toFunctionCounterLine(FunctionCounter meter, Map<String, String>

Stream<String> toFunctionTimerLine(FunctionTimer meter, Map<String, String> seenMetadata) {
long count = (long) meter.count();
double total = meter.totalTime(getBaseTimeUnit());

if (count == 0) {
logger.debug("Timer with 0 count dropped: {}", meter.getId().getName());
return Stream.empty();
}
else if (count == 1) {

double total = meter.totalTime(getBaseTimeUnit());
if (count == 1) {
// Between calling count, totalTime, and mean values can be recorded so the
// reported values might be inconsistent. In the Dynatrace API,
// this might lead to rejections, because the ingested data's validity is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ void longTaskTimerWithSingleValueExportsConsistentData() throws InterruptedExcep
// the Dynatrace specification). Therefore, for this test we need to use the
// system clock.
DynatraceConfig config = createDefaultDynatraceConfig();
DynatraceMeterRegistry registry = DynatraceMeterRegistry.builder(config).clock(Clock.SYSTEM).build();
Clock clock = Clock.SYSTEM;
DynatraceMeterRegistry registry = DynatraceMeterRegistry.builder(config).clock(clock).build();
DynatraceExporterV2 exporter = new DynatraceExporterV2(config, clock, httpClient);

LongTaskTimer ltt = LongTaskTimer.builder("ltt").register(registry);
Expand Down Expand Up @@ -402,7 +403,8 @@ void longTaskTimerWithMultipleValuesExportsConsistentData() throws InterruptedEx
// For this test we need to use the system clock.
// See longTaskTimerWithSingleValueExportsConsistentData for more info
DynatraceConfig config = createDefaultDynatraceConfig();
DynatraceMeterRegistry registry = DynatraceMeterRegistry.builder(config).clock(Clock.SYSTEM).build();
Clock clock = Clock.SYSTEM;
DynatraceMeterRegistry registry = DynatraceMeterRegistry.builder(config).clock(clock).build();
DynatraceExporterV2 exporter = new DynatraceExporterV2(config, clock, httpClient);

LongTaskTimer ltt = LongTaskTimer.builder("ltt").register(registry);
Expand All @@ -422,8 +424,6 @@ void longTaskTimerWithMultipleValuesExportsConsistentData() throws InterruptedEx
// export complete, can shut down active background thread.
executorService.shutdownNow();

assertThat(lines).hasSize(1);

// assertions
assertThat(lines).hasSize(1);
// ltt,dt.metrics.source=micrometer gauge,min=5,max=5,sum=5,count=1 1694133659649
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pluginManagement {
}

plugins {
id 'com.gradle.enterprise' version '3.14.1'
id 'com.gradle.enterprise' version '3.15'
id 'io.spring.ge.conventions' version '0.0.14'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
}
Expand Down

0 comments on commit a9edff2

Please sign in to comment.