private Map<ServiceInfo, Long> getServiceConfigGenerations(Application application,
                                                               Duration timeoutPerService,
                                                               HostsToCheck hostsToCheck) {
        List<ServiceInfo> servicesToCheck = new ArrayList<>();
        application.getModel().getHosts()
                   .forEach(host -> host.getServices().stream()
                                        .filter(service -> serviceTypesToCheck.contains(service.getServiceType()))
                                        .filter(serviceInfo -> shouldCheckService(hostsToCheck, application, serviceInfo))
                                        .forEach(service -> getStatePort(service).ifPresent(port -> servicesToCheck.add(service))));

        log.log(Level.FINE, () -> "Services to check for config convergence: " + servicesToCheck);
        return getServiceGenerations(servicesToCheck, timeoutPerService);
    }
Fetches the active config generation for all services in the given application. Will not check services
which defer config changes until restart if checkAll is false. hostsToCheck are names to check, or empty to check all.
configserver/src/main/java/com/yahoo/vespa/config/server/application/ConfigConvergenceChecker.java