From c587b9f009de8bc2e182765410395063d92b07ed Mon Sep 17 00:00:00 2001 From: peng-yongsheng <8082209@qq.com> Date: Mon, 5 Mar 2018 13:01:52 +0800 Subject: [PATCH] Report @ 2018/03/04 23:00, Dashboard [COLLECTOR] The /api/dashboard response is incorrect . Fixed the number of application bug. --- .../apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java index 8a08047d20..e3a048fb86 100644 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java +++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/InstanceEsUIDAO.java @@ -105,7 +105,13 @@ public class InstanceEsUIDAO extends EsDAO implements IInstanceUIDAO { searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); - boolQueryBuilder.must().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(startSecondTimeBucket)); + + BoolQueryBuilder timeBoolQuery = QueryBuilders.boolQuery(); + timeBoolQuery.should().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_REGISTER_TIME).gte(startSecondTimeBucket).lte(endSecondTimeBucket)); + timeBoolQuery.should().add(QueryBuilders.rangeQuery(InstanceTable.COLUMN_HEARTBEAT_TIME).gte(startSecondTimeBucket).lte(endSecondTimeBucket)); + + boolQueryBuilder.must().add(timeBoolQuery); + boolQueryBuilder.must().add(QueryBuilders.termQuery(InstanceTable.COLUMN_IS_ADDRESS, BooleanUtils.FALSE)); if (applicationIds.length > 0) { boolQueryBuilder.must().add(QueryBuilders.termsQuery(InstanceTable.COLUMN_APPLICATION_ID, applicationIds)); -- GitLab