From c90d24e66d29eddf9115909e34f660da14cc4a81 Mon Sep 17 00:00:00 2001 From: Stephen Ni Date: Sat, 19 Nov 2022 16:27:25 +0800 Subject: [PATCH] Upgrade agent-test-tools and polish dubbo plugin (#387) --- CHANGES.md | 3 +++ .../AbstractServerConstructorInterceptor.java | 1 - .../AbstractServerConstructorInterceptor.java | 1 - .../service-agent/java-agent/Plugin-test.md | 16 +++++++++------- test/plugin/agent-test-tools/pom.xml | 2 +- tools/plugin/check-javaagent-plugin-list.sh | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4c85ab32c..eefe475bc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,9 +10,12 @@ Release Notes. * Rename `JDBI` to `JDBC` * Support collecting dubbo thread pool metrics * Bump up byte-buddy to 1.12.19 +* Upgrade agent test tools #### Documentation +* Update `Plugin-test.md`, support string operators `start with` and `end with` + All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/161?closed=1) diff --git a/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/AbstractServerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/AbstractServerConstructorInterceptor.java index 75b331e77..bd3357b01 100644 --- a/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/AbstractServerConstructorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/dubbo-2.7.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo/AbstractServerConstructorInterceptor.java @@ -46,7 +46,6 @@ public class AbstractServerConstructorInterceptor implements InstanceConstructor return; } ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; - // TODO String.format("DubboServerHandler-%s:%s", host, port) will be better String threadPoolName = String.format("DubboServerHandler-%s", port); MeterFactory.gauge(METER_NAME, () -> (double) (threadPoolExecutor.getCorePoolSize())) diff --git a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/AbstractServerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/AbstractServerConstructorInterceptor.java index 99e53c66d..b26061344 100644 --- a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/AbstractServerConstructorInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/src/main/java/org/apache/skywalking/apm/plugin/dubbo/AbstractServerConstructorInterceptor.java @@ -46,7 +46,6 @@ public class AbstractServerConstructorInterceptor implements InstanceConstructor return; } ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; - // TODO String.format("DubboServerHandler-%s:%s", host, port) will be better String threadPoolName = String.format("DubboServerHandler-%s", port); MeterFactory.gauge(METER_NAME, () -> (double) (threadPoolExecutor.getCorePoolSize())) diff --git a/docs/en/setup/service-agent/java-agent/Plugin-test.md b/docs/en/setup/service-agent/java-agent/Plugin-test.md index 00282bddc..817bf33da 100644 --- a/docs/en/setup/service-agent/java-agent/Plugin-test.md +++ b/docs/en/setup/service-agent/java-agent/Plugin-test.md @@ -91,7 +91,7 @@ The following files are required in every test case. File Name | Descriptions ---|--- `configuration.yml` | Declare the basic case information, including case name, entrance endpoints, mode, and dependencies. -`expectedData.yaml` | Describe the expected segmentItems. +`expectedData.yaml` | Describe the expected segmentItems, meterItems or logItems. `support-version.list` | List the target versions for this case. `startup.sh` |`JVM-container` only. This is not required when using `Tomcat-container`. @@ -202,12 +202,14 @@ as the version number, which will be changed in the test for each version. **Operator for String** -| Operator | Description | -|:------------|:--------------------------------------------------------------------------------------------------------------| -| `not null` | Not null | -| `not blank` | Not blank ,it's recommended for String type field as the default value maybe blank string, such as span tags | -| `null` | Null or empty String | -| `eq` | Equal(default) | +| Operator | Description | +|:-------------|:--------------------------------------------------------------------------------------------------------------| +| `not null` | Not null | +| `not blank` | Not blank ,it's recommended for String type field as the default value maybe blank string, such as span tags | +| `null` | Null or empty String | +| `eq` | Equal(default) | +| `start with` | Tests if this string starts with the specified prefix. DO NOT use it with meterItem tags value | +| `end with` | Tests if this string ends with the specified suffix. DO NOT use it with meterItem tags value | **Expected Data Format Of The Segment** ```yml diff --git a/test/plugin/agent-test-tools/pom.xml b/test/plugin/agent-test-tools/pom.xml index c817cd03e..7238da230 100644 --- a/test/plugin/agent-test-tools/pom.xml +++ b/test/plugin/agent-test-tools/pom.xml @@ -35,7 +35,7 @@ pom - 7f20775e0631356c4823d9372b09d653db0e6540 + 1c0bef2dd1d828e07889302bea980b24900b0db5 ${project.basedir}/target/agent-test-tools https://github.com/apache/skywalking-agent-test-tool.git diff --git a/tools/plugin/check-javaagent-plugin-list.sh b/tools/plugin/check-javaagent-plugin-list.sh index 193e73946..46ebda6d0 100755 --- a/tools/plugin/check-javaagent-plugin-list.sh +++ b/tools/plugin/check-javaagent-plugin-list.sh @@ -22,7 +22,7 @@ WORK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &&cd ../.. && pwd)" GENERNATE_PLUGINS_LIST=${SRC_DIR}/genernate-javaagent-plugin-list.txt MD_PLUGINS_LIST=${SRC_DIR}/md-javaagent-plugin-list.txt -function genernateJavaagentPluginList() { +function generateJavaagentPluginList() { position_file="javaagent-position.txt" find ${WORK_DIR}/apm-sniffer -name "skywalking-plugin.def"|grep "src/main/resources" > ${position_file} cat ${position_file} | while read line @@ -38,7 +38,7 @@ function getMdJavaagentPluginList() { cat ${md_javaagent_plugins_file}|grep -v "#" |awk -F " " '{ print $2}'|grep -E '^[a-z].*'|sort|uniq|awk NF >${MD_PLUGINS_LIST} } -genernateJavaagentPluginList +generateJavaagentPluginList getMdJavaagentPluginList diff -w -bB -U0 ${MD_PLUGINS_LIST} ${GENERNATE_PLUGINS_LIST}