Skip to content

Commit

Permalink
Instance sort
Browse files Browse the repository at this point in the history
  • Loading branch information
peng-yongsheng committed Sep 16, 2017
1 parent dbdd083 commit ec03cc5
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -12,6 +12,7 @@
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.metrics.sum.Sum;
import org.elasticsearch.search.sort.SortOrder;
import org.skywalking.apm.collector.core.util.Const;
import org.skywalking.apm.collector.core.util.TimeBucketUtils;
import org.skywalking.apm.collector.storage.define.instance.InstPerformanceTable;
Expand All @@ -33,6 +34,7 @@ public class InstPerformanceEsDAO extends EsDAO implements IInstPerformanceDAO {

searchRequestBuilder.setQuery(boolQuery);
searchRequestBuilder.setSize(0);
searchRequestBuilder.addSort(InstPerformanceTable.COLUMN_INSTANCE_ID, SortOrder.ASC);

searchRequestBuilder.addAggregation(AggregationBuilders.sum(InstPerformanceTable.COLUMN_CALLS).field(InstPerformanceTable.COLUMN_CALLS));
searchRequestBuilder.addAggregation(AggregationBuilders.sum(InstPerformanceTable.COLUMN_COST_TOTAL).field(InstPerformanceTable.COLUMN_COST_TOTAL));
Expand Down

0 comments on commit ec03cc5

Please sign in to comment.