You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/02/23 15:50:40 UTC

[skywalking] branch master updated: Fix wrong time for OTEL mock service, invalid condition(ge 0) for e2e cases (#10437)

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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new cc7a2c9e97 Fix wrong time for OTEL mock service, invalid condition(ge 0) for e2e cases (#10437)
cc7a2c9e97 is described below

commit cc7a2c9e97fd2c421adbe3e9c471688459a446d9
Author: pg.yang <pg...@hotmail.com>
AuthorDate: Thu Feb 23 23:50:25 2023 +0800

    Fix wrong time for OTEL mock service, invalid condition(ge 0) for e2e cases (#10437)
---
 test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml |  39 ++---
 .../aws/dynamodb/expected/metrics-has-value.yml    |   2 +-
 .../cases/aws/dynamodb/mock-data/data-1.json       | 179 ++++++++++++++++++++-
 test/e2e-v2/cases/aws/eks/eks-cases.yaml           |   2 +-
 .../cases/aws/eks/expected/metrics-has-value.yml   |   2 +-
 .../cases/aws/eks/mock-data/otel-mock-metrics.json |   2 +-
 .../cases/aws/s3/expected/metrics-has-value.yml    |   2 +-
 test/e2e-v2/cases/aws/s3/mock-data/data-1.json     |   2 +
 .../expected/metrics-has-value-percentile.yml      |  10 +-
 .../cases/meter/expected/metrics-has-value0.yml    |  19 ---
 test/e2e-v2/cases/meter/meter-cases.yaml           |   4 +-
 ...etrics-has-value0.yml => metrics-has-value.yml} |   0
 test/e2e-v2/cases/virtual-mq/mq-cases.yaml         |   4 +-
 .../cases/win/expected/metrics-has-value.yml       |   6 +-
 test/e2e-v2/cases/win/win-cases.yaml               |  10 +-
 .../e2e/controller/OtelMetricsSender.java          |   2 +-
 16 files changed, 207 insertions(+), 78 deletions(-)

diff --git a/test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml b/test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml
index a67cf6a3b5..1f623dcfe2 100644
--- a/test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml
+++ b/test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml
@@ -20,62 +20,45 @@ cases:
     expected: expected/service.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_max_writes --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_account_max_writes --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_max_reads --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_max_provisioned_read_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=max_provisioned_write_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_account_max_table_level_reads --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=max_provisioned_read_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_account_max_table_level_writes --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_max_table_level_reads --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_account_provisioned_read_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_max_table_level_writes --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_time_to_live_deleted_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_provisioned_read_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_user_errors --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=account_provisioned_write_capacity_utilization --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_read_system_errors --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=time_to_live_deleted_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_write_system_errors --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=user_errors --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_scan_returned_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
   - query: |
       swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=system_errors --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
-    expected: expected/metrics-has-value.yml
-  - query: |
-      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=scan_returned_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
-    expected: expected/metrics-has-value.yml
-  - query: |
-      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=query_returned_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
-    expected: expected/metrics-has-value.yml
-
-  - query: |
-      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=read_throttled_requests --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
-    expected: expected/metrics-has-value.yml
-  - query: |
-      swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear \
-        --name=write_throttled_requests --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
+        --name=aws_dynamodb_query_returned_item_count --service-name aws-dynamodb::xxxxxxxx |yq e 'to_entries' -
     expected: expected/metrics-has-value.yml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/aws/dynamodb/expected/metrics-has-value.yml b/test/e2e-v2/cases/aws/dynamodb/expected/metrics-has-value.yml
index 61632d4fd3..ee6b0a2f26 100644
--- a/test/e2e-v2/cases/aws/dynamodb/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/aws/dynamodb/expected/metrics-has-value.yml
@@ -15,5 +15,5 @@
 
   {{- contains . }}
 - key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
+  value: {{ gt .value 0 }}
   {{- end }}
\ No newline at end of file
diff --git a/test/e2e-v2/cases/aws/dynamodb/mock-data/data-1.json b/test/e2e-v2/cases/aws/dynamodb/mock-data/data-1.json
index f4882e142f..7df4ea5061 100644
--- a/test/e2e-v2/cases/aws/dynamodb/mock-data/data-1.json
+++ b/test/e2e-v2/cases/aws/dynamodb/mock-data/data-1.json
@@ -340,12 +340,14 @@
                     "startTimeUnixNano": "1676809260000000000",
                     "timeUnixNano": "1676809320000000000",
                     "count": "1",
-                    "sum": "2.0",
+                    "sum": "1.0",
                     "quantileValues": [
                       {
+                        "value": 1.0
                       },
                       {
-                        "quantile": 1.0
+                        "quantile": 1.0,
+                        "value": 1.0
                       }
                     ],
                     "attributes": [
@@ -381,12 +383,14 @@
                     "startTimeUnixNano": "1676809260000000000",
                     "timeUnixNano": "1676809320000000000",
                     "count": "1",
-                    "sum": "2.0",
+                    "sum": "5.0",
                     "quantileValues": [
                       {
+                        "value": 5.0
                       },
                       {
-                        "quantile": 1.0
+                        "quantile": 1.0,
+                        "value": 5.0
                       }
                     ],
                     "attributes": [
@@ -428,12 +432,14 @@
                     "startTimeUnixNano": "1676809260000000000",
                     "timeUnixNano": "1676809320000000000",
                     "count": "1",
-                    "sum": "2.0",
+                    "sum": "5.0",
                     "quantileValues": [
                       {
+                        "value": 5.0
                       },
                       {
-                        "quantile": 1.0
+                        "quantile": 1.0,
+                        "value": 5.0
                       }
                     ],
                     "attributes": [
@@ -466,6 +472,104 @@
                 ]
               }
             },
+            {
+              "name": "amazonaws.com/AWS/DynamoDB/ThrottledRequests",
+              "unit": "{Count}",
+              "summary": {
+                "dataPoints": [
+                  {
+                    "startTimeUnixNano": "1676809260000000000",
+                    "timeUnixNano": "1676809320000000000",
+                    "count": "1",
+                    "sum": "2.0",
+                    "quantileValues": [
+                      {
+                        "value": 2.0
+                      },
+                      {
+                        "quantile": 1.0,
+                        "value": 2.0
+                      }
+                    ],
+                    "attributes": [
+                      {
+                        "key": "Namespace",
+                        "value": {
+                          "stringValue": "AWS/DynamoDB"
+                        }
+                      },
+                      {
+                        "key": "MetricName",
+                        "value": {
+                          "stringValue": "ThrottledRequests"
+                        }
+                      },
+                      {
+                        "key": "Operation",
+                        "value": {
+                          "stringValue": "Query"
+                        }
+                      },
+                      {
+                        "key": "TableName",
+                        "value": {
+                          "stringValue": "test"
+                        }
+                      }
+                    ]
+                  }
+                ]
+              }
+            },
+            {
+              "name": "amazonaws.com/AWS/DynamoDB/ThrottledRequests",
+              "unit": "{Count}",
+              "summary": {
+                "dataPoints": [
+                  {
+                    "startTimeUnixNano": "1676809260000000000",
+                    "timeUnixNano": "1676809320000000000",
+                    "count": "1",
+                    "sum": "2.0",
+                    "quantileValues": [
+                      {
+                        "value": 2.0
+                      },
+                      {
+                        "quantile": 1.0,
+                        "value": 2.0
+                      }
+                    ],
+                    "attributes": [
+                      {
+                        "key": "Namespace",
+                        "value": {
+                          "stringValue": "AWS/DynamoDB"
+                        }
+                      },
+                      {
+                        "key": "MetricName",
+                        "value": {
+                          "stringValue": "ThrottledRequests"
+                        }
+                      },
+                      {
+                        "key": "Operation",
+                        "value": {
+                          "stringValue": "PutItem"
+                        }
+                      },
+                      {
+                        "key": "TableName",
+                        "value": {
+                          "stringValue": "test"
+                        }
+                      }
+                    ]
+                  }
+                ]
+              }
+            },
             {
               "name": "amazonaws.com/AWS/DynamoDB/UserErrors",
               "unit": "{Count}",
@@ -478,9 +582,11 @@
                     "sum": "2.0",
                     "quantileValues": [
                       {
+                        "value": 2.0
                       },
                       {
-                        "quantile": 1.0
+                        "quantile": 1.0,
+                        "value": 2.0
                       }
                     ],
                     "attributes": [
@@ -519,9 +625,11 @@
                     "sum": "2.0",
                     "quantileValues": [
                       {
+                        "value": 2.0
                       },
                       {
-                        "quantile": 1.0
+                        "quantile": 1.0,
+                        "value": 2.0
                       }
                     ],
                     "attributes": [
@@ -542,6 +650,61 @@
                         "value": {
                           "stringValue": "test"
                         }
+                      },
+                      {
+                        "key": "Operation",
+                        "value": {
+                          "stringValue": "GetItem"
+                        }
+                      }
+                    ]
+                  }
+                ]
+              }
+            },
+            {
+              "name": "amazonaws.com/AWS/DynamoDB/SystemErrors",
+              "unit": "{Count}",
+              "summary": {
+                "dataPoints": [
+                  {
+                    "startTimeUnixNano": "1676809260000000000",
+                    "timeUnixNano": "1676809320000000000",
+                    "count": "1",
+                    "sum": "2.0",
+                    "quantileValues": [
+                      {
+                        "value": 2.0
+                      },
+                      {
+                        "quantile": 1.0,
+                        "value": 2.0
+                      }
+                    ],
+                    "attributes": [
+                      {
+                        "key": "Namespace",
+                        "value": {
+                          "stringValue": "AWS/DynamoDB"
+                        }
+                      },
+                      {
+                        "key": "MetricName",
+                        "value": {
+                          "stringValue": "SystemErrors"
+                        }
+                      },
+                      {
+                        "key": "TableName",
+                        "value": {
+                          "stringValue": "test"
+                        }
+                      },
+                      {
+                        "key": "Operation",
+                        "value": {
+                          "stringValue": "PutItem"
+                        }
                       }
                     ]
                   }
diff --git a/test/e2e-v2/cases/aws/eks/eks-cases.yaml b/test/e2e-v2/cases/aws/eks/eks-cases.yaml
index 9e53b3982c..b377583ac2 100644
--- a/test/e2e-v2/cases/aws/eks/eks-cases.yaml
+++ b/test/e2e-v2/cases/aws/eks/eks-cases.yaml
@@ -22,7 +22,7 @@
       expected:  expected/instance.yml
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint ls --service-name=aws-eks-cluster::SkyWalking
       expected:  expected/endpoint.yml
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=eks_cluster_node_memory_utilization --service-name=aws-eks-cluster::SkyWalking --instance-name=ip-172-31-23-33.ap-northeast-1.compute.internal | yq e 'to_entries' -
+    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=eks_cluster_node_memory_utilization --service-name=aws-eks-cluster::SkyWalking --instance-name=ip-172-31-10-158.ap-northeast-1.compute.internal | yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=eks_cluster_service_pod_net_rx_bytes --service-name=aws-eks-cluster::SkyWalking --endpoint-name=kube-dns  | yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
diff --git a/test/e2e-v2/cases/aws/eks/expected/metrics-has-value.yml b/test/e2e-v2/cases/aws/eks/expected/metrics-has-value.yml
index ce1f3d83c8..f7092ba3fa 100644
--- a/test/e2e-v2/cases/aws/eks/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/aws/eks/expected/metrics-has-value.yml
@@ -15,5 +15,5 @@
 
 {{- contains . }}
 - key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
+  value: {{ gt .value 0 }}
 {{- end }}
diff --git a/test/e2e-v2/cases/aws/eks/mock-data/otel-mock-metrics.json b/test/e2e-v2/cases/aws/eks/mock-data/otel-mock-metrics.json
index 892cb4a75b..ed478099fb 100644
--- a/test/e2e-v2/cases/aws/eks/mock-data/otel-mock-metrics.json
+++ b/test/e2e-v2/cases/aws/eks/mock-data/otel-mock-metrics.json
@@ -264,7 +264,7 @@
                 "dataPoints": [
                   {
                     "timeUnixNano": "1669442684150753695",
-                    "asDouble": 0
+                    "asDouble": 80
                   }
                 ]
               }
diff --git a/test/e2e-v2/cases/aws/s3/expected/metrics-has-value.yml b/test/e2e-v2/cases/aws/s3/expected/metrics-has-value.yml
index ce1f3d83c8..f7092ba3fa 100644
--- a/test/e2e-v2/cases/aws/s3/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/aws/s3/expected/metrics-has-value.yml
@@ -15,5 +15,5 @@
 
 {{- contains . }}
 - key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
+  value: {{ gt .value 0 }}
 {{- end }}
diff --git a/test/e2e-v2/cases/aws/s3/mock-data/data-1.json b/test/e2e-v2/cases/aws/s3/mock-data/data-1.json
index 7d97bca7bf..717d5a946e 100644
--- a/test/e2e-v2/cases/aws/s3/mock-data/data-1.json
+++ b/test/e2e-v2/cases/aws/s3/mock-data/data-1.json
@@ -41,6 +41,7 @@
                     "startTimeUnixNano": "1674547500000000000",
                     "timeUnixNano": "1674547560000000000",
                     "count": "1",
+                    "sum": "5",
                     "quantileValues": [
                       {
                       },
@@ -87,6 +88,7 @@
                     "startTimeUnixNano": "1674547500000000000",
                     "timeUnixNano": "1674547560000000000",
                     "count": "1",
+                    "sum": "5",
                     "quantileValues": [
                       {
                       },
diff --git a/test/e2e-v2/cases/meter/expected/metrics-has-value-percentile.yml b/test/e2e-v2/cases/meter/expected/metrics-has-value-percentile.yml
index b126c5d550..9f9935ba8f 100644
--- a/test/e2e-v2/cases/meter/expected/metrics-has-value-percentile.yml
+++ b/test/e2e-v2/cases/meter/expected/metrics-has-value-percentile.yml
@@ -18,30 +18,30 @@
   value:
   {{- contains .value }}
   - key: {{ notEmpty .key }}
-    value: {{ ge .value 0 }}
+    value: {{ gt .value 0 }}
   {{- end }}
 - key: 1
   value:
   {{- contains .value }}
   - key: {{ notEmpty .key }}
-    value: {{ ge .value 0 }}
+    value: {{ gt .value 0 }}
   {{- end }}
 - key: 2
   value:
   {{- contains .value }}
   - key: {{ notEmpty .key }}
-    value: {{ ge .value 0 }}
+    value: {{ gt .value 0 }}
   {{- end }}
 - key: 3
   value:
   {{- contains .value }}
   - key: {{ notEmpty .key }}
-    value: {{ ge .value 0 }}
+    value: {{ gt .value 0 }}
   {{- end }}
 - key: 4
   value:
   {{- contains .value }}
   - key: {{ notEmpty .key }}
-    value: {{ ge .value 0 }}
+    value: {{ gt .value 0 }}
   {{- end }}
 {{- end }}
diff --git a/test/e2e-v2/cases/meter/expected/metrics-has-value0.yml b/test/e2e-v2/cases/meter/expected/metrics-has-value0.yml
deleted file mode 100644
index ce1f3d83c8..0000000000
--- a/test/e2e-v2/cases/meter/expected/metrics-has-value0.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-{{- contains . }}
-- key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
-{{- end }}
diff --git a/test/e2e-v2/cases/meter/meter-cases.yaml b/test/e2e-v2/cases/meter/meter-cases.yaml
index ace00892bc..02e05a2143 100644
--- a/test/e2e-v2/cases/meter/meter-cases.yaml
+++ b/test/e2e-v2/cases/meter/meter-cases.yaml
@@ -35,7 +35,7 @@
     # virtual cache
     - query: |
         swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=cache_read_resp_time  --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0  | yq e 'to_entries' -
-      expected: expected/metrics-has-value0.yml
+      expected: expected/metrics-has-value.yml
     - query: |
         swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=cache_write_sla  --service-id=R3VhdmFDYWNoZS1sb2NhbA==.0  | yq e 'to_entries' -
       expected: expected/metrics-has-value.yml
@@ -48,4 +48,4 @@
       # virtual database
     - query: |
         swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=database_access_resp_time  --service-id=bG9jYWxob3N0Oi0x.0  | yq e 'to_entries' -
-      expected: expected/metrics-has-value0.yml
\ No newline at end of file
+      expected: expected/metrics-has-value.yml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/virtual-mq/expected/metrics-has-value0.yml b/test/e2e-v2/cases/virtual-mq/expected/metrics-has-value.yml
similarity index 100%
rename from test/e2e-v2/cases/virtual-mq/expected/metrics-has-value0.yml
rename to test/e2e-v2/cases/virtual-mq/expected/metrics-has-value.yml
diff --git a/test/e2e-v2/cases/virtual-mq/mq-cases.yaml b/test/e2e-v2/cases/virtual-mq/mq-cases.yaml
index ea4a5be878..3d6708688d 100644
--- a/test/e2e-v2/cases/virtual-mq/mq-cases.yaml
+++ b/test/e2e-v2/cases/virtual-mq/mq-cases.yaml
@@ -22,7 +22,7 @@
       expected: expected/service-endpoint.yml
     # endpoint metrics
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=mq_service_consume_latency --service-id=a2Fma2E6OTA5Mg==.0 |yq e 'to_entries' -
-      expected: expected/metrics-has-value0.yml
+      expected: expected/metrics-has-value.yml
     # endpoint metrics
     - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=mq_endpoint_consume_cpm --endpoint-name='topic' --service-id=a2Fma2E6OTA5Mg==.0 |yq e 'to_entries' -
-      expected: expected/metrics-has-value0.yml
\ No newline at end of file
+      expected: expected/metrics-has-value.yml
\ No newline at end of file
diff --git a/test/e2e-v2/cases/win/expected/metrics-has-value.yml b/test/e2e-v2/cases/win/expected/metrics-has-value.yml
index ce1f3d83c8..75b746f204 100644
--- a/test/e2e-v2/cases/win/expected/metrics-has-value.yml
+++ b/test/e2e-v2/cases/win/expected/metrics-has-value.yml
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-{{- contains . }}
+  {{- contains . }}
 - key: {{ notEmpty .key }}
-  value: {{ ge .value 0 }}
-{{- end }}
+  value: {{ ge .value 1 }}
+  {{- end }}
diff --git a/test/e2e-v2/cases/win/win-cases.yaml b/test/e2e-v2/cases/win/win-cases.yaml
index c41b102a95..3945fa9b91 100644
--- a/test/e2e-v2/cases/win/win-cases.yaml
+++ b/test/e2e-v2/cases/win/win-cases.yaml
@@ -15,8 +15,8 @@
 
 # This file is used to show how to write configuration files and can be used to test.
 
-  cases:
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
-      expected: expected/service.yml
-    - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_win_cpu_total_percentage --service-name=10.211.55.3 | yq e 'to_entries' -
-      expected: expected/metrics-has-value.yml
+cases:
+  - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
+    expected: expected/service.yml
+  - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=meter_win_memory_swap_total --service-name=10.211.55.3 | yq e 'to_entries' -
+    expected: expected/metrics-has-value.yml
diff --git a/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/OtelMetricsSender.java b/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/OtelMetricsSender.java
index 9f741b72a5..1d1012a9b8 100644
--- a/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/OtelMetricsSender.java
+++ b/test/e2e-v2/java-test-service/e2e-mock-sender/src/main/java/org/apache/skywalking/e2e/controller/OtelMetricsSender.java
@@ -89,7 +89,7 @@ public class OtelMetricsSender {
     }
 
     private String rewriteTimeField(File file) throws IOException {
-        final long nanoTime = System.nanoTime();
+        final long nanoTime = System.currentTimeMillis() * 1000000L;
         final Configuration configuration = Configuration.builder()
                                                          .options(Option.SUPPRESS_EXCEPTIONS)
                                                          .evaluationListener(found -> {