Skip to content

Commit

Permalink
add e2e testcase, sync ui, add tips.
Browse files Browse the repository at this point in the history
  • Loading branch information
CzyerChen committed Sep 16, 2024
1 parent 1a219fc commit bce7fb8
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"i": "14",
"type": "Widget",
"widget": {
"title": "Tracing Context Creation (Per Minute)"
"title": "Tracing Context Creation (Per Minute)",
"tips": "The number of created tracing contexts per minute, including a label created_by(value=sampler,propagated)."
},
"graph": {
"type": "Line",
Expand All @@ -33,7 +34,8 @@
"i": "6",
"type": "Widget",
"widget": {
"title": "Tracing Context Creation and Completion (Per Minute)"
"title": "Tracing Context Creation and Completion (Per Minute)",
"tips": "The number of created tracing contexts and finished tracing contexts per minute."
},
"graph": {
"type": "Line",
Expand Down Expand Up @@ -64,7 +66,8 @@
"i": "1",
"type": "Widget",
"widget": {
"title": "Ignored Context Creation (Per Minute)"
"title": "Ignored Context Creation (Per Minute)",
"tips": "The number of created ignored contexts per minute, including a label created_by(value=sampler,propagated)."
},
"graph": {
"type": "Line",
Expand All @@ -86,7 +89,8 @@
"i": "2",
"type": "Widget",
"widget": {
"title": "Ignored Context Creation and Completion (Per Minute)"
"title": "Ignored Context Creation and Completion (Per Minute)",
"tips": "The number of created ignored contexts and finished ignored contexts per minute."
},
"graph": {
"type": "Line",
Expand Down Expand Up @@ -117,7 +121,8 @@
"i": "11",
"type": "Widget",
"widget": {
"title": "Possible Leaked Context (Per Minute)"
"title": "Possible Leaked Context (Per Minute)",
"tips": "The number of detected leaked contexts per minute, including a label source(value=tracing, ignore)."
},
"graph": {
"type": "Line",
Expand All @@ -144,7 +149,8 @@
"i": "8",
"type": "Widget",
"widget": {
"title": "Interceptor Error Count (Per Minute)"
"title": "Interceptor Error Count (Per Minute)",
"tips": "The number of errors happened in the interceptor logic per minute, including the label plugin_name and inter_type(constructor, inst, static)."
},
"graph": {
"type": "Line",
Expand Down Expand Up @@ -179,7 +185,8 @@
"showYAxis": true
},
"widget": {
"title": "Tracing Context Execution time (ms)"
"title": "Tracing Context Execution time (ms)",
"tips": "For successfully finished tracing context, it measures every interceptor's time cost."
},
"expressions": [
"relabels(meter_java_agent_tracing_context_execution_time_percentile,p='50,75,90,95,99',p='50,75,90,95,99')/1000000"
Expand Down
2 changes: 1 addition & 1 deletion skywalking-ui
2 changes: 1 addition & 1 deletion test/e2e-v2/cases/meter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ version: '2.1'
services:
oap:
environment:
SW_METER_ANALYZER_ACTIVE_FILES: spring-micrometer,batch-meter
SW_METER_ANALYZER_ACTIVE_FILES: spring-micrometer,batch-meter,java-agent
#virtual cache test case
SW_SLOW_CACHE_SLOW_WRITE_THRESHOLD: default:-1
SW_SLOW_CACHE_SLOW_READ_THRESHOLD: default:-1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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.

type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels:
{{- contains .metric.labels }}
- key: created_by
value: {{ .value }}
{{- end}}
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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.

type: TIME_SERIES_VALUES
results:
{{- contains .results }}
- metric:
labels:
- key: p
value: "50"
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
- metric:
labels:
- key: p
value: "70"
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
- metric:
labels:
- key: p
value: "90"
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
- metric:
labels:
- key: p
value: "99"
values:
{{- contains .values }}
- id: {{ notEmpty .id }}
value: {{ .value }}
traceid: null
- id: {{ notEmpty .id }}
value: null
traceid: null
{{- end}}
{{- end}}
error: null
17 changes: 9 additions & 8 deletions test/e2e-v2/cases/meter/expected/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
# limitations under the License.

{{- contains . }}
- id: {{ b64enc "e2e-service-provider" }}.1
name: e2e-service-provider
group: ""
shortname: e2e-service-provider
normal: true
layers:
- GENERAL

- id: {{ b64enc "localhost:-1" }}.0
name: localhost:-1
group: ""
Expand All @@ -30,6 +22,15 @@
layers:
- VIRTUAL_DATABASE

- id: {{ b64enc "e2e-service-provider" }}.1
name: e2e-service-provider
group: ""
shortname: e2e-service-provider
normal: true
layers:
- SO11Y_JAVA_AGENT
- GENERAL

- id: {{ b64enc "GuavaCache-local" }}.0
name: GuavaCache-local
group: ""
Expand Down
12 changes: 12 additions & 0 deletions test/e2e-v2/cases/meter/meter-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,15 @@
- query: |
swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=database_access_resp_time --service-id=bG9jYWxob3N0Oi0x.0
expected: expected/metrics-has-value.yml
# agent so11y
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_java_agent_created_tracing_context_count --instance-name=provider1 --service-name=e2e-service-provider
expected: expected/metrics-has-value-label-created_by.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_java_agent_finished_tracing_context_count --instance-name=provider1 --service-name=e2e-service-provider
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_java_agent_created_ignored_context_count --instance-name=provider1 --service-name=e2e-service-provider
expected: expected/metrics-has-value-label-created_by.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_java_agent_finished_ignored_context_count --instance-name=provider1 --service-name=e2e-service-provider
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_java_agent_tracing_context_execution_time_percentile --instance-name=provider1 --service-name=e2e-service-provider
expected: expected/metrics-has-value-label-percentile.yml

Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import java.io.IOException;
import java.net.URL;
import lombok.RequiredArgsConstructor;
import org.apache.skywalking.apm.toolkit.trace.TraceContext;
import org.apache.skywalking.e2e.User;
import org.apache.skywalking.e2e.UserRepo;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -59,13 +62,19 @@ public String info() throws InterruptedException {
}

@PostMapping("/users")
public User createAuthor(@RequestBody final User user) throws InterruptedException {
public User createAuthor(@RequestBody final User user) throws InterruptedException, IOException {
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
new URL("http://localhost:9090/agent-so11y-scenario/case/ignore.html").getContent();
//virtual cache test case
testCacheService();
return userRepo.save(user);
}

@GetMapping("/ignore.html")
public String ignore() {
return "success";
}

@PostMapping("/correlation")
public String correlation() throws InterruptedException {
Thread.sleep(randomSleepLong(sleepMin, sleepMax));
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-v2/script/env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SW_AGENT_JAVA_COMMIT=c82287e1dd1593cf3e7dbc390b92f9224943252a
SW_AGENT_JAVA_COMMIT=75364241659c28e64557a3edffd53b9a8ae46188
SW_AGENT_SATELLITE_COMMIT=ea27a3f4e126a24775fe12e2aa2695bcb23d99c3
SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
SW_AGENT_NODEJS_COMMIT=4f9a91dad3dfd8cfe5ba8f7bd06b39e11eb5e65e
Expand Down

0 comments on commit bce7fb8

Please sign in to comment.