From 3252b6ed0858c0ca7b5a7b5c66c94438e2b9b286 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Fri, 31 Jan 2020 21:11:43 +0800 Subject: [PATCH] provide profile analyze empty interfaces (#4303) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * provide profile analyze empty interfaces * fix comment error * change comments * update submodule Co-authored-by: 吴晟 Wu Sheng --- .../core/query/entity/ProfileAnalyzation.java | 35 ++++++++++++++ .../query/entity/ProfileStackElement.java | 48 +++++++++++++++++++ .../query/graphql/resolver/ProfileQuery.java | 12 +++++ .../src/main/resources/query-protocol | 2 +- 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileAnalyzation.java create mode 100644 oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileStackElement.java diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileAnalyzation.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileAnalyzation.java new file mode 100644 index 000000000..f6b444e2e --- /dev/null +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileAnalyzation.java @@ -0,0 +1,35 @@ +/* + * 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.oap.server.core.query.entity; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * @author MrPro + */ +@Getter +@Setter +public class ProfileAnalyzation { + + private List stack; + +} diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileStackElement.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileStackElement.java new file mode 100644 index 000000000..f97ae5e4a --- /dev/null +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/entity/ProfileStackElement.java @@ -0,0 +1,48 @@ +/* + * 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.oap.server.core.query.entity; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +/** + * @author MrPro + */ +@Getter +@Setter +public class ProfileStackElement { + + // stack code signature + private String codeSignature; + + // include the execution time of children(millisecond) + private int duration; + + // exclude the execution time of children(millisecond) + private int durationChildExcluded; + + // continuous dump count + private int count; + + // children of this stack code sign + private List childs; + +} diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/ProfileQuery.java b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/ProfileQuery.java index 5fec0743f..5c9abb271 100644 --- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/ProfileQuery.java +++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/ProfileQuery.java @@ -21,10 +21,13 @@ package org.apache.skywalking.oap.query.graphql.resolver; import com.coxautodev.graphql.tools.GraphQLQueryResolver; import org.apache.skywalking.oap.server.core.CoreModule; import org.apache.skywalking.oap.server.core.query.ProfileTaskQueryService; +import org.apache.skywalking.oap.server.core.query.entity.BasicTrace; +import org.apache.skywalking.oap.server.core.query.entity.ProfileAnalyzation; import org.apache.skywalking.oap.server.core.query.entity.ProfileTask; import org.apache.skywalking.oap.server.library.module.ModuleManager; import java.io.IOException; +import java.util.Collections; import java.util.List; /** @@ -52,5 +55,14 @@ public class ProfileQuery implements GraphQLQueryResolver { return getProfileTaskQueryService().getTaskList(serviceId, endpointName); } + public List getProfileTaskSegmentList(final String taskID) { + return Collections.emptyList(); + } + + public ProfileAnalyzation getProfileAnalyze(final String segmentId, final long start, final long end) { + ProfileAnalyzation analyzation = new ProfileAnalyzation(); + analyzation.setStack(Collections.emptyList()); + return analyzation; + } } diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol index 03ed7858e..138a0573c 160000 --- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol +++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/resources/query-protocol @@ -1 +1 @@ -Subproject commit 03ed7858ea05ade81b9ceaa3abe468b422ce8110 +Subproject commit 138a0573cfcc5a44a99d3063b43d314faee8654a