File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
agent/instrumentation/micrometer-1.0 Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,6 @@ dependencies {
4242
4343tasks {
4444 withType<Test >().configureEach {
45- jvmArgs(" -Dapplicationinsights.internal.micrometer.step.millis=100 " )
45+ jvmArgs(" -Dapplicationinsights.internal.micrometer.step.millis=1000 " )
4646 }
4747}
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments