From 5567e86538c882037141f62640078e29fc3d16c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=8B=87=E5=8D=87=20pengys?= <8082209@qq.com> Date: Mon, 24 Sep 2018 23:27:03 +0800 Subject: [PATCH] Update aggregation.graphqls (#6) * Update aggregation.graphqls Split getTopN into multiple methods, with each scope as a separate method. * Update aggregation.graphqls Add order parameter and add 2 methods for all query. --- aggregation.graphqls | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/aggregation.graphqls b/aggregation.graphqls index 1e834a1..b059fd8 100644 --- a/aggregation.graphqls +++ b/aggregation.graphqls @@ -14,23 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Match the metric by name, order by metric value(such as: avg, percent) -input TopNCondition { - name: String! - topN: Int! - order: Order! - # When the scope is ServiceInstance or Endpoint, - # most likely you need a secondary filter. - # Such as: - # 1. Get topN service instance in a given service id - # 2. Get topN endpoint in a given serivce id. - # Backend will decide the filter id meaning by Scope. - # - # Defintely, it is not required by default. - filterScope: Scope - filterId: ID -} - type TopNEntity { name: String! id: ID! @@ -41,5 +24,9 @@ type TopNEntity { # All aggregation queries require backend or/and storage do aggregation in query time. extend type Query { # TopN is an aggregation query. - getTopN(condition: TopNCondition!, duration: Duration!): [TopNEntity!]! + getServiceTopN(name: String!, topN: Int!, duration: Duration!, order: Order!): [TopNEntity!]! + getAllServiceInstanceTopN(name: String!, topN: Int!, duration: Duration!, order: Order!): [TopNEntity!]! + getServiceInstanceTopN(serviceId Int!, name: String!, topN: Int!, duration: Duration!, order: Order!): [TopNEntity!]! + getAllEndpointTopN(name: String!, topN: Int!, duration: Duration!, order: Order!): [TopNEntity!]! + getEndpointTopN(serviceId Int!, name: String!, topN: Int!, duration: Duration!, order: Order!): [TopNEntity!]! } -- GitLab