Skip to content

Commit 305b437

Browse files
committed
debug
1 parent c78bfd3 commit 305b437

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

agent/instrumentation/micrometer-1.0/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ dependencies {
4242

4343
tasks {
4444
withType<Test>().configureEach {
45-
jvmArgs("-Dapplicationinsights.internal.micrometer.step.millis=100")
45+
jvmArgs("-Dapplicationinsights.internal.micrometer.step.millis=1000")
4646
}
4747
}

agent/instrumentation/micrometer-1.0/src/test/java/MicrometerTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,18 @@ void shouldCaptureTimer() {
132132
CompositeMeterRegistry registry = Metrics.globalRegistry;
133133
Timer timer = Timer.builder("test-timer").register(registry);
134134

135+
System.out.println("before record");
136+
135137
// when
136138
timer.record(Duration.ofMillis(44));
137139
timer.record(Duration.ofMillis(55));
138140

139-
System.out.println("TIMER COUNT: " + timer.count());
141+
System.out.println("after record");
142+
143+
// Class clazz = Class.forName("io.micrometer.core.instrument.composite.AbstractCompositeMeter");
144+
// Method firstChild = clazz.getDeclaredMethod("firstChild");
145+
// firstChild.setAccessible(true);
146+
// Timer realTimer = (Timer) firstChild.invoke(timer);
140147

141148
// then
142149
waitAtMost(Duration.ofSeconds(20)).until(() -> getLastMeasurement("test-timer") != null);
@@ -159,11 +166,13 @@ void shouldCaptureDistributionSummary() {
159166
DistributionSummary distributionSummary =
160167
DistributionSummary.builder("test-summary").register(registry);
161168

169+
System.out.println("before record");
170+
162171
// when
163172
distributionSummary.record(4.4);
164173
distributionSummary.record(5.5);
165174

166-
System.out.println("DISTRIBUTION SUMMARY COUNT: " + distributionSummary.count());
175+
System.out.println("after record");
167176

168177
// then
169178
waitAtMost(Duration.ofSeconds(20)).until(() -> getLastMeasurement("test-summary") != null);

0 commit comments

Comments
 (0)