Bumping versions

This commit is contained in:
spring-builds
2024-11-25 16:10:35 +00:00
parent 96c7ec7072
commit 4236eb2af3
2 changed files with 17 additions and 17 deletions

View File

@@ -79,10 +79,10 @@ public class EurekaInstanceMonitor implements SmartApplicationListener {
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) {

View File

@@ -48,8 +48,8 @@ import static org.springframework.cloud.netflix.eureka.server.EurekaInstanceFixt
*/
@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";
@@ -92,17 +92,17 @@ class EurekaInstanceMonitorWithCustomTagsProviderTests {
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)