kezhenxu94 commented on a change in pull request #4239: Provide influxdb as a 
new storage plugin
URL: https://github.com/apache/skywalking/pull/4239#discussion_r379828752
 
 

 ##########
 File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/TimeBucket.java
 ##########
 @@ -32,10 +32,119 @@ public static long getRecordTimeBucket(long time) {
         return getTimeBucket(time, Downsampling.Second);
     }
 
+    /**
+     * Record time bucket format in Minute Unit.
+     *
+     * @param time Timestamp
+     * @return time in minute format.
+     */
     public static long getMinuteTimeBucket(long time) {
         return getTimeBucket(time, Downsampling.Minute);
     }
 
+    /**
+     * Convert TimeBucket to Timestamp in millisecond.
+     *
+     * @param timeBucket long
+     * @return timestamp in millisecond unit
+     */
+    public static long getTimestamp(long timeBucket) {
+        if (isSecondBucket(timeBucket)) {
+            return getTimestamp(timeBucket, Downsampling.Second);
+        } else if (isMinuteBucket(timeBucket)) {
+            return getTimestamp(timeBucket, Downsampling.Minute);
+        } else if (isHourBucket(timeBucket)) {
+            return getTimestamp(timeBucket, Downsampling.Hour);
+        } else if (isDayBucket(timeBucket)) {
+            return getTimestamp(timeBucket, Downsampling.Day);
+        } else if (isMonthBucket(timeBucket)) {
+            return getTimestamp(timeBucket, Downsampling.Month);
+        } else {
+            throw new UnexpectedException("Unknown downsampling value.");
+        }
+    }
+
+    /**
+     * The format of timeBucket in minute Unit is "yyyyMMddHHmmss", so which 
means the TimeBucket mush between
 
 Review comment:
   `mush` -> `must be`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to