wu-sheng commented on code in PR #12432:
URL: https://github.com/apache/skywalking/pull/12432#discussion_r1673947962


##########
oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/measure/BanyanDBTagAutocompleteQueryDAO.java:
##########
@@ -54,12 +54,16 @@ public 
BanyanDBTagAutocompleteQueryDAO(BanyanDBStorageClient client) {
     @Override
     public Set<String> queryTagAutocompleteKeys(TagType tagType, int limit, 
Duration duration) throws IOException {
         MetadataRegistry.Schema schema = 
MetadataRegistry.INSTANCE.findMetadata(TagAutocompleteData.INDEX_NAME, 
DownSampling.Minute);
-        long startTB = 0;
-        long endTB = 0;
+        long startSecondTB = 0;
+        long endSecondTB = 0;
         if (nonNull(duration)) {
-            startTB = 
TimeBucket.getMinuteTimeBucket(duration.getStartTimestamp());
-            endTB = TimeBucket.getMinuteTimeBucket(duration.getEndTimestamp());
+            startSecondTB = duration.getStartTimeBucketInSec();
+            endSecondTB = duration.getEndTimeBucketInSec();
         }
+
+        long startTB = startSecondTB / 1000000 * 10000;
+        long endTB = endSecondTB / 1000000 * 10000 + 2359;

Review Comment:
   Same here, and the second method could be 
`TimeBucket#retainToDayLastMin4MinuteBucket`



##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/searchtag/TagAutocompleteDispatcher.java:
##########
@@ -30,7 +30,8 @@ public void dispatch(TagAutocomplete source) {
         autocomplete.setTagKey(source.getTagKey());
         autocomplete.setTagValue(source.getTagValue());
         autocomplete.setTagType(source.getTagType().name());
-        autocomplete.setTimeBucket(source.getTimeBucket());
+        // change the precision in Day for reduce the storage
+        autocomplete.setTimeBucket(source.getTimeBucket() / 10000 * 10000);

Review Comment:
   `TimeBucket#retainToDay4MinuteBucket` should be the place to host this 
`/10000 * 10000` logic



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to