This is an automated email from the ASF dual-hosted git repository. wusheng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push: new 058335f Query server time info (#3498) 058335f is described below commit 058335f21a8ed1058fe414a5425f65439748441a Author: Kdump <rootshell...@gmail.com> AuthorDate: Sun Sep 22 19:06:33 2019 +0800 Query server time info (#3498) * sync ui * query-server-time-info * query-server-time-info * query-server-time-info * query-server-time-info * query-server-time-info * sync skywalking-query-protocol * sync ui * sync ui * sync skywalking-query-protocol * sync skywalking-query-protocol --- .../oap/query/graphql/resolver/MetadataQuery.java | 12 ++++++++ .../oap/query/graphql/type/TimeInfo.java | 35 ++++++++++++++++++++++ .../src/main/resources/query-protocol | 2 +- skywalking-ui | 2 +- 4 files changed, 49 insertions(+), 2 deletions(-) diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java index 986d6a6..d2cc8b1 100644 --- a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java +++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/resolver/MetadataQuery.java @@ -21,8 +21,11 @@ package org.apache.skywalking.oap.query.graphql.resolver; import com.coxautodev.graphql.tools.GraphQLQueryResolver; import java.io.IOException; import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import org.apache.skywalking.oap.query.graphql.type.Duration; +import org.apache.skywalking.oap.query.graphql.type.TimeInfo; import org.apache.skywalking.oap.server.core.CoreModule; import org.apache.skywalking.oap.server.core.query.*; import org.apache.skywalking.oap.server.core.query.entity.*; @@ -93,4 +96,13 @@ public class MetadataQuery implements GraphQLQueryResolver { public List<Database> getAllDatabases(final Duration duration) throws IOException { return getMetadataQueryService().getAllDatabases(); } + + public TimeInfo getTimeInfo() { + TimeInfo timeInfo = new TimeInfo(); + SimpleDateFormat timezoneFormat = new SimpleDateFormat("ZZZZZZ"); + Date date = new Date(); + timeInfo.setCurrentTimestamp(date.getTime()); + timeInfo.setTimezone(timezoneFormat.format(date)); + return timeInfo; + } } diff --git a/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/type/TimeInfo.java b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/type/TimeInfo.java new file mode 100644 index 0000000..fd018a2 --- /dev/null +++ b/oap-server/server-query-plugin/query-graphql-plugin/src/main/java/org/apache/skywalking/oap/query/graphql/type/TimeInfo.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.query.graphql.type; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class TimeInfo { + /** + * server current timezone, format: +0800 + */ + private String timezone; + /** + * server current timestamp, format: 1569124528392 + */ + private Long currentTimestamp; +} 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 6fc9665..f9bb3fe 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 6fc96650acc7f539fcdf6d51648525ce93e5fa1a +Subproject commit f9bb3fe4d85b7c989d0692f38c3341c3c13646e7 diff --git a/skywalking-ui b/skywalking-ui index 206a514..5583a33 160000 --- a/skywalking-ui +++ b/skywalking-ui @@ -1 +1 @@ -Subproject commit 206a514ae71267e5b29ac58dba2dbfeaf71a7b2d +Subproject commit 5583a332551aa957a63e865ee2c42d892ed52de6