public Thermodynamic getThermodynamic(final MetricCondition metrics,
                                          final Duration duration) throws IOException {
        MetricsCondition condition = new MetricsCondition();
        condition.setName(metrics.getName());
        condition.setEntity(new MockEntity(metrics.getId()));

        final HeatMap heatMap = query.readHeatMap(condition, duration).join();

        Thermodynamic thermodynamic = new Thermodynamic();
        final List<Bucket> buckets = heatMap.getBuckets();

        if (buckets.size() > 1) {
            // Use the first bucket size as the axis Y step, because in the previous(before 8.x),
            // We only use equilong bucket.
            // Use 1 to avoid `infinite-` as bucket#min
            thermodynamic.setAxisYStep(buckets.get(1).duration());
        } else {
            // Used to be a static config.
            thermodynamic.setAxisYStep(200);
        }

        for (int x = 0; x < heatMap.getValues().size(); x++) {
            final HeatMap.HeatMapColumn heatMapColumn = heatMap.getValues().get(x);
            for (int y = 0; y < heatMapColumn.getValues().size(); y++) {
                thermodynamic.addNodeValue(x, y, heatMapColumn.getValues().get(y));
            }
        }

        return thermodynamic;
    }
@since 8.0.0 This query is replaced by {@link MetricsQuery}
oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetricQuery.java