Skip to content

Commit

Permalink
Bumping versions
Browse files Browse the repository at this point in the history
  • Loading branch information
spring-builds committed Nov 25, 2024
1 parent 96c7ec7 commit 4236eb2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public void onApplicationEvent(ApplicationEvent event) {

private Map<Tags, Long> collectAggregatedCounts() {
return instanceRegistry.getApplications()
.getRegisteredApplications()
.stream()
.flatMap(application -> application.getInstances().stream())
.collect(Collectors.groupingBy(tagProvider::eurekaInstanceTags, Collectors.counting()));
.getRegisteredApplications()
.stream()
.flatMap(application -> application.getInstances().stream())
.collect(Collectors.groupingBy(tagProvider::eurekaInstanceTags, Collectors.counting()));
}

private void registerMetrics(Map<Tags, Long> aggregatedCounts) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
*/
@SpringBootTest(classes = EurekaInstanceMonitorWithCustomTagsProviderTests.Application.class,
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
value = {"spring.application.name=eureka", "eureka.server.metrics.enabled=true",
"eureka.client.register-with-eureka=false", "eureka.client.fetch-registry=false"})
value = { "spring.application.name=eureka", "eureka.server.metrics.enabled=true",
"eureka.client.register-with-eureka=false", "eureka.client.fetch-registry=false" })
class EurekaInstanceMonitorWithCustomTagsProviderTests {

private static final String APP_NAME = "FOO-APP-NAME";
Expand Down Expand Up @@ -92,17 +92,17 @@ private static Tags tags(InstanceInfo instanceInfo) {

private void assertEurekaInstance(Map<Tags, Long> meterRegistryCounts) {
await().atMost(5, SECONDS)
.pollInterval(fibonacci())
.untilAsserted(() -> meterRegistryCounts.forEach((tags,
count) -> {
SoftAssertions softAssertions = new SoftAssertions();
softAssertions.assertThat((long) meterRegistry.get("eureka.server.instances")
.tags(tags).gauge().value()).isNotNull();
softAssertions.assertThat((long) meterRegistry.get("eureka.server.instances")
.tags(tags).gauge().value())
.isEqualTo(count);
softAssertions.assertAll();
}));
.pollInterval(fibonacci())
.untilAsserted(() -> meterRegistryCounts.forEach((tags, count) -> {
SoftAssertions softAssertions = new SoftAssertions();
softAssertions
.assertThat((long) meterRegistry.get("eureka.server.instances").tags(tags).gauge().value())
.isNotNull();
softAssertions
.assertThat((long) meterRegistry.get("eureka.server.instances").tags(tags).gauge().value())
.isEqualTo(count);
softAssertions.assertAll();
}));
}

@Configuration(proxyBeanMethods = false)
Expand Down

0 comments on commit 4236eb2

Please sign in to comment.