public List<TopNEntity> getAllServiceInstanceTopN(final String name, final int topN, final Duration duration,
                                                      final Order order) throws IOException {
        TopNCondition condition = new TopNCondition();
        condition.setName(name);
        condition.setScope(Scope.ServiceInstance);
        condition.setOrder(order);
        condition.setTopN(topN);
        List<TopNEntity> list = new ArrayList<>();
        query.sortMetrics(condition, duration).join().forEach(selectedRecord -> {
            TopNEntity entity = new TopNEntity(selectedRecord);
            list.add(entity);
        });
        return list;
    }
@since 8.0.0 This query is replaced by {@link MetricsQuery}, all queries have been delegated to there.
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/AggregationQuery.java