You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/12/29 09:26:42 UTC

[GitHub] [skywalking] mrproliu commented on a change in pull request #4145: Provide thread monitor create task feature

mrproliu commented on a change in pull request #4145: Provide thread monitor create task feature
URL: https://github.com/apache/skywalking/pull/4145#discussion_r361837433
 
 

 ##########
 File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/profile/IThreadMonitorTaskQueryDAO.java
 ##########
 @@ -0,0 +1,52 @@
+/*
+ * 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.storage.profile;
+
+import org.apache.skywalking.oap.server.core.query.entity.ThreadMonitorTask;
+import org.apache.skywalking.oap.server.core.storage.DAO;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * process all thread monitor task query
+ *
+ * @author MrPro
+ */
+public interface IThreadMonitorTaskQueryDAO extends DAO {
+
+    /**
+     * get all thread monitor task start time in time range
+     * @param serviceId monitor service id
+     * @param taskStartTime task start time bigger than or equals
+     * @param taskEndTime task start time smaller than or equals
+     * @return
+     */
+    List<ThreadMonitorTask> getTaskListSearchOnStartTime(final int serviceId, final long taskStartTime, final long taskEndTime) throws IOException;
+
+    /**
+     * search task list in appoint time bucket
+     * @param serviceId monitor service id, maybe null
+     * @param endpointName endpoint name, maybe empty
+     * @param startTimeBucket time bucket bigger than or equals
+     * @param endTimeBucket time bucket small than or equals
+     * @return
+     */
+    List<ThreadMonitorTask> getTaskList(final Integer serviceId, final String endpointName, final long startTimeBucket, final long endTimeBucket) throws IOException;
 
 Review comment:
   they are using different logic.
   `getTaskListSearchOnStartTime`: It will use on creating a new task to check limit, Each service can monitor up to 1 endpoints during the execution of tasks. search time range on task start time.
   `getTaskList`: It will use on the UI level GraphQL searching. search time range on time bucket.
   At present, I don't have any good way to optimize these two methods.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services