public List<ServiceInstance> listInstances(final Duration duration,
                                                     final String serviceId) throws IOException {
        if (duration.getStartTimestamp() >= duration.getEndTimestamp()) {
            return Collections.emptyList();
        }
        return getMetadataQueryDAO().listInstances(duration, serviceId)
                                    .stream().distinct().collect(Collectors.toList());
    }
@return all services, key is service id, value is services with different layers.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetadataQueryService.java