Bumping versions
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user