This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch index
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/index by this push:
     new eb0189c8 fix the issues when mulit-segments is here
eb0189c8 is described below

commit eb0189c801ebbde6dea15c13261eb531bc6889ae
Author: Gao Hongtao <[email protected]>
AuthorDate: Sat Nov 16 19:57:27 2024 +0800

    fix the issues when mulit-segments is here
    
    Signed-off-by: Gao Hongtao <[email protected]>
---
 test/cases/init.go                                 |   2 +-
 ..._expired.json => service_traffic_data_old.json} |  38 ++++++
 .../measure/data/want/index_mode_all_segs.yaml     | 137 +++++++++++++++++++++
 test/cases/measure/measure.go                      |   2 +-
 4 files changed, 177 insertions(+), 2 deletions(-)

diff --git a/test/cases/init.go b/test/cases/init.go
index 2b6467eb..64b60fae 100644
--- a/test/cases/init.go
+++ b/test/cases/init.go
@@ -41,7 +41,7 @@ func Initialize(addr string, now time.Time) {
        casesstreamdata.Write(conn, "duplicated", now, 0)
        // // measure
        interval = time.Minute
-       casesmeasuredata.Write(conn, "service_traffic", "sw_metric", 
"service_traffic_data_expired.json", now.AddDate(0, 0, -1), interval)
+       casesmeasuredata.Write(conn, "service_traffic", "sw_metric", 
"service_traffic_data_old.json", now.AddDate(0, 0, -1), interval)
        casesmeasuredata.Write(conn, "service_traffic", "sw_metric", 
"service_traffic_data.json", now, interval)
        casesmeasuredata.Write(conn, "service_instance_traffic", "sw_metric", 
"service_instance_traffic_data.json", now, interval)
        casesmeasuredata.Write(conn, "service_cpm_minute", "sw_metric", 
"service_cpm_minute_data.json", now, interval)
diff --git a/test/cases/measure/data/testdata/service_traffic_data_expired.json 
b/test/cases/measure/data/testdata/service_traffic_data_old.json
similarity index 75%
rename from test/cases/measure/data/testdata/service_traffic_data_expired.json
rename to test/cases/measure/data/testdata/service_traffic_data_old.json
index 55d3dc06..58246fdd 100644
--- a/test/cases/measure/data/testdata/service_traffic_data_expired.json
+++ b/test/cases/measure/data/testdata/service_traffic_data_old.json
@@ -112,5 +112,43 @@
         ]
       }
     ]
+  },
+  {
+    "tag_families": [
+      {
+        "tags": [
+          {
+            "str": {
+              "value": "4"
+            }
+          },
+          {
+            "str": {
+              "value": "service_4"
+            }
+          },
+          {
+            "str": {
+              "value": "service_name_4"
+            }
+          },
+          {
+            "str": {
+              "value": "service_short_name_4"
+            }
+          },
+          {
+            "str": {
+              "value": "group4"
+            }
+          },
+          {
+            "int": {
+              "value": 3
+            }
+          }
+        ]
+      }
+    ]
   }
 ]
\ No newline at end of file
diff --git a/test/cases/measure/data/want/index_mode_all_segs.yaml 
b/test/cases/measure/data/want/index_mode_all_segs.yaml
new file mode 100644
index 00000000..a10946c6
--- /dev/null
+++ b/test/cases/measure/data/want/index_mode_all_segs.yaml
@@ -0,0 +1,137 @@
+# Licensed to 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. Apache Software Foundation (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.
+dataPoints:
+- sid: "15142466043926325685"
+  tagFamilies:
+  - name: default
+    tags:
+    - key: id
+      value:
+        str:
+          value: "1"
+    - key: service_id
+      value:
+        str:
+          value: service_1
+    - key: name
+      value:
+        str:
+          value: service_name_1
+    - key: short_name
+      value:
+        str:
+          value: service_short_name_1
+    - key: service_group
+      value:
+        str:
+          value: group1
+    - key: layer
+      value:
+        int:
+          value: "1"
+  timestamp: "2024-11-16T11:17:00Z"
+  version: "1"
+- sid: "3906119849472468294"
+  tagFamilies:
+  - name: default
+    tags:
+    - key: id
+      value:
+        str:
+          value: "2"
+    - key: service_id
+      value:
+        str:
+          value: service_2
+    - key: name
+      value:
+        str:
+          value: service_name_2
+    - key: short_name
+      value:
+        str:
+          value: service_short_name_2
+    - key: service_group
+      value:
+        str:
+          value: group1
+    - key: layer
+      value:
+        int:
+          value: "2"
+  timestamp: "2024-11-16T11:18:00Z"
+  version: "1"
+- sid: "12370392692163567533"
+  tagFamilies:
+  - name: default
+    tags:
+    - key: id
+      value:
+        str:
+          value: "3"
+    - key: service_id
+      value:
+        str:
+          value: service_3
+    - key: name
+      value:
+        str:
+          value: service_name_3
+    - key: short_name
+      value:
+        str:
+          value: service_short_name_3
+    - key: service_group
+      value:
+        str:
+          value: group1
+    - key: layer
+      value:
+        int:
+          value: "1"
+  timestamp: "2024-11-16T11:19:00Z"
+  version: "1"
+- sid: "16450204962168035869"
+  tagFamilies:
+  - name: default
+    tags:
+    - key: id
+      value:
+        str:
+          value: "4"
+    - key: service_id
+      value:
+        str:
+          value: service_4
+    - key: name
+      value:
+        str:
+          value: service_name_4
+    - key: short_name
+      value:
+        str:
+          value: service_short_name_4
+    - key: service_group
+      value:
+        str:
+          value: group4
+    - key: layer
+      value:
+        int:
+          value: "3"
+  timestamp: "2024-11-15T11:19:00Z"
+  version: "1"
diff --git a/test/cases/measure/measure.go b/test/cases/measure/measure.go
index 2499ca5f..39bd2bf3 100644
--- a/test/cases/measure/measure.go
+++ b/test/cases/measure/measure.go
@@ -73,7 +73,7 @@ var _ = g.DescribeTable("Scanning Measures", verify,
        g.Entry("duplicated in a part", helpers.Args{Input: "duplicated_part", 
Duration: 25 * time.Minute, Offset: -20 * time.Minute}),
        g.Entry("match a tag belongs to the entity", helpers.Args{Input: 
"entity_match", Duration: 25 * time.Minute, Offset: -20 * time.Minute}),
        g.Entry("all of index mode", helpers.Args{Input: "index_mode_all", 
Duration: 25 * time.Minute, Offset: -20 * time.Minute}),
-       g.FEntry("all in all segments of index mode", helpers.Args{Input: 
"index_mode_all", Duration: 36 * time.Minute, Offset: -48 * time.Hour}),
+       g.Entry("all in all segments of index mode", helpers.Args{Input: 
"index_mode_all", Want: "index_mode_all_segs", Duration: 72 * time.Hour, 
Offset: -48 * time.Hour}),
        g.Entry("order by desc of index mode", helpers.Args{Input: 
"index_mode_order_desc", Duration: 25 * time.Minute, Offset: -20 * 
time.Minute}),
        g.Entry("range of index mode", helpers.Args{Input: "index_mode_range", 
Duration: 25 * time.Minute, Offset: -20 * time.Minute}),
        g.Entry("none of index mode", helpers.Args{Input: "index_mode_none", 
WantEmpty: true, Duration: 25 * time.Minute, Offset: -20 * time.Minute}),

Reply via email to