wu-sheng closed pull request #1074: DAO interface document.
URL: https://github.com/apache/incubator-skywalking/pull/1074
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java
 
b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java
index 30c5f4ce3..1d0a383ed 100644
--- 
a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java
+++ 
b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/ui/ICpuMetricUIDAO.java
@@ -20,12 +20,38 @@
 
 import java.util.List;
 import org.apache.skywalking.apm.collector.storage.base.dao.DAO;
+import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable;
 import org.apache.skywalking.apm.collector.storage.ui.common.Step;
 import org.apache.skywalking.apm.collector.storage.utils.DurationPoint;
 
 /**
+ * Interface to be implemented for execute database query operation
+ * from {@link CpuMetricTable#TABLE}.
+ *
  * @author peng-yongsheng
+ * @see org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
+ * @see org.apache.skywalking.apm.collector.storage.StorageModule
  */
 public interface ICpuMetricUIDAO extends DAO {
+
+    /**
+     * Execute a database query operation, implemented in different
+     * storage module.
+     * <p>SQL as: select USAGE_PERCENT, TIMES from CPU_METRIC where ID in 
(durationPoints)
+     * <p>The average usage percent formula is "USAGE_PERCENT/TIMES", multiply 
the result
+     * by 100 and cast the class to {@link Integer}, in order to avoid the 
result includes
+     * decimal value, it make the javascript hard to use the decimal value.
+     * <p>Every time points must add the query result into return collection 
even if not
+     * exist in the target database, and remain the order of return collection 
to be same
+     * as durationPoints collection.
+     * <p>Use {@link 
org.apache.skywalking.apm.collector.storage.utils.TimePyramidTableNameBuilder#build(Step,
 String)}
+     * to generate table name which mixed with step name.
+     *
+     * @param instanceId the owner id of this cpu metrics
+     * @param step the step which represent time formats
+     * @param durationPoints the time points in the time span
+     * @return every duration points average cpu usage percent metrics.
+     * @see org.apache.skywalking.apm.collector.storage.ui.common.Step
+     */
     List<Integer> getCPUTrend(int instanceId, Step step, List<DurationPoint> 
durationPoints);
 }


 

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


With regards,
Apache Git Services

Reply via email to