diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java index 46e82826a6f1872be760b2266ff8eb34507b3c7e..97f93f3ffda851d6ef7d3a6ed83e117988b42873 100644 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ISegmentDurationUIDAO.java @@ -19,7 +19,9 @@ package org.apache.skywalking.apm.collector.storage.dao.ui; import org.apache.skywalking.apm.collector.storage.base.dao.DAO; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; /** * Interface to be implemented for execute database query operation @@ -55,5 +57,5 @@ public interface ISegmentDurationUIDAO extends DAO { * @return not nullable result list */ TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, String... segmentIds); + String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds); } diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java new file mode 100644 index 0000000000000000000000000000000000000000..2f0a5f9d1297981ccc8ab3959cc89afeef76b9f0 --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/QueryOrder.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.ui.trace; + +public enum QueryOrder { + BY_START_TIME, + BY_DURATION +} diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java index 86bea1abe517d830cfb32c579e3113eac070bd01..103d700432f19388bac246844702ddf0642fbece 100644 --- a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceQueryCondition.java @@ -31,6 +31,25 @@ public class TraceQueryCondition { private Duration queryDuration; private int minTraceDuration; private int maxTraceDuration; + private TraceState traceState; + private QueryOrder queryOrder; + + public TraceState getTraceState() { + return traceState; + } + + public void setTraceState(TraceState traceState) { + this.traceState = traceState; + } + + public QueryOrder getQueryOrder() { + return queryOrder; + } + + public void setQueryOrder(QueryOrder queryOrder) { + this.queryOrder = queryOrder; + } + private Pagination paging; public int getApplicationId() { diff --git a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java new file mode 100644 index 0000000000000000000000000000000000000000..71b52dd1453931cee1d73886334fe24f124a6a38 --- /dev/null +++ b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/trace/TraceState.java @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.apache.skywalking.apm.collector.storage.ui.trace; + +public enum TraceState { + ALL, + SUCCESS, + ERROR +} diff --git a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java index 1a1fc9292a7bbdf5dd9af42d1725b05dc13c3254..40374a2acafeb8d72507806f8ee170b159ce3663 100644 --- a/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java +++ b/apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java @@ -27,7 +27,9 @@ import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; import org.apache.skywalking.apm.collector.storage.es.base.dao.EsDAO; import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; import org.elasticsearch.action.search.SearchRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchType; @@ -49,7 +51,7 @@ public class SegmentDurationEsUIDAO extends EsDAO implements ISegmentDurationUID @Override public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, String... segmentIds) { + String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds) { SearchRequestBuilder searchRequestBuilder = getClient().prepareSearch(SegmentDurationTable.TABLE); searchRequestBuilder.setTypes(SegmentDurationTable.TABLE_TYPE); searchRequestBuilder.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); @@ -81,8 +83,22 @@ public class SegmentDurationEsUIDAO extends EsDAO implements ISegmentDurationUID if (applicationId != 0) { boolQueryBuilder.must().add(QueryBuilders.termQuery(SegmentDurationTable.APPLICATION_ID.getName(), applicationId)); } - - searchRequestBuilder.addSort(SegmentDurationTable.START_TIME.getName(), SortOrder.DESC); + switch (traceState) { + case ERROR: + mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), BooleanUtils.TRUE)); + break; + case SUCCESS: + mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), BooleanUtils.FALSE)); + break; + } + switch (queryOrder) { + case BY_START_TIME: + searchRequestBuilder.addSort(SegmentDurationTable.START_TIME.getName(), SortOrder.DESC); + break; + case + BY_DURATION:searchRequestBuilder.addSort(SegmentDurationTable.DURATION.getName(), SortOrder.DESC); + break; + } searchRequestBuilder.setSize(limit); searchRequestBuilder.setFrom(from); diff --git a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java index 4cc9e366b467550fe7a96881472b95855aba544c..5f154e8318ebf4765524e123fd8531730c911270 100644 --- a/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java +++ b/apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/apache/skywalking/apm/collector/storage/h2/dao/ui/SegmentDurationH2UIDAO.java @@ -31,7 +31,9 @@ import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; import org.apache.skywalking.apm.collector.storage.h2.base.dao.H2DAO; import org.apache.skywalking.apm.collector.storage.table.segment.SegmentDurationTable; import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +50,7 @@ public class SegmentDurationH2UIDAO extends H2DAO implements ISegmentDurationUID @Override public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, int applicationId, int limit, int from, String... segmentIds) { + String operationName, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder, String... segmentIds) { H2Client client = getClient(); String sql = "select * from {0} where {1} >= ? and {1} <= ?"; List params = new ArrayList<>(); @@ -90,8 +92,30 @@ public class SegmentDurationH2UIDAO extends H2DAO implements ISegmentDurationUID params.add(applicationId); columns.add(SegmentDurationTable.APPLICATION_ID.getName()); } + if (traceState != null) { + paramIndex++; + sql = sql + " and {" + paramIndex + "} = ?"; + switch (traceState) { + case ERROR: + params.add(BooleanUtils.TRUE); + break; + case SUCCESS: + params.add(BooleanUtils.FALSE); + break; + } + + columns.add(SegmentDurationTable.IS_ERROR); + } sql = sql + " limit " + from + "," + limit; + switch (queryOrder) { + case BY_START_TIME: + sql = sql + " queryOrder by " + SegmentDurationTable.START_TIME.getName() + " dsc"; + break; + case BY_DURATION: + sql = sql + " queryOrder by " + SegmentDurationTable.DURATION.getName() + " dsc"; + break; + } sql = SqlBuilder.buildSql(sql, columns); Object[] p = params.toArray(new Object[0]); diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java index 595adc5553cf56ec3e786015a620e6bb940a768d..12461838adf4fa65cca43aa0552177b5f3538b92 100644 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java +++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/query/TraceQuery.java @@ -22,9 +22,7 @@ import org.apache.skywalking.apm.collector.core.UnexpectedException; import org.apache.skywalking.apm.collector.core.module.ModuleManager; import org.apache.skywalking.apm.collector.core.util.Const; import org.apache.skywalking.apm.collector.core.util.StringUtils; -import org.apache.skywalking.apm.collector.storage.ui.trace.Trace; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; -import org.apache.skywalking.apm.collector.storage.ui.trace.TraceQueryCondition; +import org.apache.skywalking.apm.collector.storage.ui.trace.*; import org.apache.skywalking.apm.collector.ui.graphql.Query; import org.apache.skywalking.apm.collector.ui.service.SegmentTopService; import org.apache.skywalking.apm.collector.ui.service.TraceStackService; @@ -81,9 +79,11 @@ public class TraceQuery implements Query { long maxDuration = condition.getMaxTraceDuration(); String operationName = condition.getOperationName(); int applicationId = condition.getApplicationId(); + TraceState traceState = condition.getTraceState(); + QueryOrder queryOrder = condition.getQueryOrder(); PaginationUtils.Page page = PaginationUtils.INSTANCE.exchange(condition.getPaging()); - return getSegmentTopService().loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, traceId, applicationId, page.getLimit(), page.getFrom()); + return getSegmentTopService().loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, traceId, applicationId, page.getLimit(), page.getFrom(),traceState,queryOrder); } public Trace queryTrace(String traceId) { diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java index 55a356f28a3b9dbb00b42143e453948a07893fea..e16b902b2c2fa2e7fcd9e2020a3ce7865a82565c 100644 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java +++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopService.java @@ -25,7 +25,9 @@ import org.apache.skywalking.apm.collector.core.util.StringUtils; import org.apache.skywalking.apm.collector.storage.StorageModule; import org.apache.skywalking.apm.collector.storage.dao.ui.IGlobalTraceUIDAO; import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,12 +47,12 @@ public class SegmentTopService { } public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, long minDuration, long maxDuration, - String operationName, - String traceId, int applicationId, int limit, int from) { + String operationName, + String traceId, int applicationId, int limit, int from, TraceState traceState, QueryOrder queryOrder) { logger.debug("startSecondTimeBucket: {}, endSecondTimeBucket: {}, minDuration: {}, " + - "maxDuration: {}, operationName: {}, traceId: {}, applicationId: {}, limit: {}, from: {}", + "maxDuration: {}, operationName: {}, traceId: {}, applicationId: {}, limit: {}, from: {}, traceState: {}, queryOrder: {}", startSecondTimeBucket, endSecondTimeBucket, minDuration, - maxDuration, operationName, traceId, applicationId, limit, from); + maxDuration, operationName, traceId, applicationId, limit, from,traceState,queryOrder); TraceBrief traceBrief; if (StringUtils.isNotEmpty(traceId)) { @@ -58,9 +60,9 @@ public class SegmentTopService { if (CollectionUtils.isEmpty(segmentIds)) { return new TraceBrief(); } - traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from, segmentIds.toArray(new String[0])); + traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from, traceState, queryOrder, segmentIds.toArray(new String[0])); } else { - traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from); + traceBrief = segmentDurationUIDAO.loadTop(startSecondTimeBucket, endSecondTimeBucket, minDuration, maxDuration, operationName, applicationId, limit, from, traceState, queryOrder); } traceBrief.getTraces().forEach(trace -> { diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java index c6a655e2e373141226b33a5cdbe54c5e4c71e12a..1368af3ac2440ce55e02c1e2f9defa2b642448cf 100644 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java +++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/query/TraceQueryTest.java @@ -21,7 +21,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.skywalking.apm.collector.storage.ui.common.Duration; import org.apache.skywalking.apm.collector.storage.ui.common.Pagination; import org.apache.skywalking.apm.collector.storage.ui.common.Step; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceQueryCondition; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; import org.apache.skywalking.apm.collector.ui.service.SegmentTopService; import org.apache.skywalking.apm.collector.ui.service.TraceStackService; import org.junit.Assert; @@ -61,12 +63,14 @@ public class TraceQueryTest { duration.setEnd("2017-02"); duration.setStep(Step.MONTH); traceQueryCondition.setQueryDuration(duration); + traceQueryCondition.setQueryOrder(QueryOrder.BY_START_TIME); + traceQueryCondition.setTraceState(TraceState.ALL); traceQueryCondition.setPaging(new Pagination()); Mockito.when(segmentTopService.loadTop( Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong(), Mockito.anyString(), Mockito.anyString(), - Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt() + Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt(), Mockito.anyObject(), Mockito.anyObject() ) ).then(invocation -> { Object[] arguments = invocation.getArguments(); diff --git a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java index c9de3545c69aba65d49514e7f27d314f4d157b96..d7274652ba2207230fe901758a768a713bc4b10d 100644 --- a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java +++ b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/test/java/org/apache/skywalking/apm/collector/ui/service/SegmentTopServiceTest.java @@ -24,7 +24,9 @@ import org.apache.skywalking.apm.collector.storage.dao.ui.ISegmentDurationUIDAO; import org.apache.skywalking.apm.collector.storage.ui.common.Duration; import org.apache.skywalking.apm.collector.storage.ui.common.Step; import org.apache.skywalking.apm.collector.storage.ui.trace.BasicTrace; +import org.apache.skywalking.apm.collector.storage.ui.trace.QueryOrder; import org.apache.skywalking.apm.collector.storage.ui.trace.TraceBrief; +import org.apache.skywalking.apm.collector.storage.ui.trace.TraceState; import org.apache.skywalking.apm.collector.ui.utils.DurationUtils; import org.junit.Assert; import org.junit.Before; @@ -68,11 +70,11 @@ public class SegmentTopServiceTest { long startSecondTimeBucket = DurationUtils.INSTANCE.startTimeDurationToSecondTimeBucket(duration.getStep(), duration.getStart()); long endSecondTimeBucket = DurationUtils.INSTANCE.endTimeDurationToSecondTimeBucket(duration.getStep(), duration.getEnd()); when(globalTraceUIDAO.getSegmentIds(anyString())).then(invocation -> Collections.singletonList("segmentIds")); - when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt())).then(invocation -> getTrace()); - when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt(), anyObject())).then(invocation -> getTrace()); - TraceBrief traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", null, 1, 10, 0); + when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt(),anyObject(),anyObject())).then(invocation -> getTrace()); + when(segmentDurationUIDAO.loadTop(anyLong(), anyLong(), anyLong(), anyLong(), anyString(), anyInt(), anyInt(), anyInt(), anyObject(),anyObject(),anyObject())).then(invocation -> getTrace()); + TraceBrief traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", null, 1, 10, 0,TraceState.ALL,QueryOrder.BY_START_TIME); Assert.assertTrue(traceBrief.getTraces().size() == 1); - traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", "traceId", 1, 10, 0); + traceBrief = segmentTopService.loadTop(startSecondTimeBucket, endSecondTimeBucket, 0, 1, "test", "traceId", 1, 10, 0,TraceState.ALL,QueryOrder.BY_START_TIME); Assert.assertTrue(traceBrief.getTraces().size() == 1); } diff --git a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls index 4d17d58c834f768601faf9e49d8495bd66de0646..e6f336b284d962fc964eab8bebaaab00b9d711fd 100644 --- a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls +++ b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/trace.graphqls @@ -42,9 +42,17 @@ input TraceQueryCondition { minTraceDuration: Int # The max time of trace maxTraceDuration: Int + traceState: TraceState! + queryOrder: QueryOrder! paging: Pagination! } +enum TraceState { + ALL + SUCCESS + ERROR +} + enum QueryOrder { BY_START_TIME BY_DURATION