提交 058335f2 编写于 作者: K Kdump 提交者: wu-sheng

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
上级 701d980f
......@@ -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;
}
}
/*
* 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;
}
Subproject commit 6fc96650acc7f539fcdf6d51648525ce93e5fa1a
Subproject commit f9bb3fe4d85b7c989d0692f38c3341c3c13646e7
Subproject commit 206a514ae71267e5b29ac58dba2dbfeaf71a7b2d
Subproject commit 5583a332551aa957a63e865ee2c42d892ed52de6
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册