Skip to content

Commit

Permalink
Fix wrong time for OTEL mock service, invalid condition(ge 0) for e2e…
Browse files Browse the repository at this point in the history
… cases (apache#10437)
  • Loading branch information
pg-yang authored Feb 23, 2023
1 parent 46ee924 commit cc7a2c9
Show file tree
Hide file tree
Showing 16 changed files with 207 additions and 78 deletions.
39 changes: 11 additions & 28 deletions test/e2e-v2/cases/aws/dynamodb/dynamodb-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 0 }}
value: {{ gt .value 0 }}
{{- end }}
179 changes: 171 additions & 8 deletions test/e2e-v2/cases/aws/dynamodb/mock-data/data-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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}",
Expand All @@ -478,9 +582,11 @@
"sum": "2.0",
"quantileValues": [
{
"value": 2.0
},
{
"quantile": 1.0
"quantile": 1.0,
"value": 2.0
}
],
"attributes": [
Expand Down Expand Up @@ -519,9 +625,11 @@
"sum": "2.0",
"quantileValues": [
{
"value": 2.0
},
{
"quantile": 1.0
"quantile": 1.0,
"value": 2.0
}
],
"attributes": [
Expand All @@ -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"
}
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-v2/cases/aws/eks/eks-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/e2e-v2/cases/aws/eks/expected/metrics-has-value.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 0 }}
value: {{ gt .value 0 }}
{{- end }}
2 changes: 1 addition & 1 deletion test/e2e-v2/cases/aws/eks/mock-data/otel-mock-metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
"dataPoints": [
{
"timeUnixNano": "1669442684150753695",
"asDouble": 0
"asDouble": 80
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-v2/cases/aws/s3/expected/metrics-has-value.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@

{{- contains . }}
- key: {{ notEmpty .key }}
value: {{ ge .value 0 }}
value: {{ gt .value 0 }}
{{- end }}
2 changes: 2 additions & 0 deletions test/e2e-v2/cases/aws/s3/mock-data/data-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"startTimeUnixNano": "1674547500000000000",
"timeUnixNano": "1674547560000000000",
"count": "1",
"sum": "5",
"quantileValues": [
{
},
Expand Down Expand Up @@ -87,6 +88,7 @@
"startTimeUnixNano": "1674547500000000000",
"timeUnixNano": "1674547560000000000",
"count": "1",
"sum": "5",
"quantileValues": [
{
},
Expand Down
Loading

0 comments on commit cc7a2c9

Please sign in to comment.