Skip to content

Commit

Permalink
[test/plugin] immigrate jedis scenario (#3811)
Browse files Browse the repository at this point in the history
* jedis scenario

* update doc
  • Loading branch information
arugal authored and wu-sheng committed Nov 9, 2019
1 parent cbe03da commit 48bcac2
Show file tree
Hide file tree
Showing 12 changed files with 513 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Jenkinsfile-Agent-Test-4
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pipeline {
}
}

stage('Test Cases Report (135)') {
stage('Test Cases Report (153)') {
steps {
echo "Test Cases Report"
}
Expand Down Expand Up @@ -101,6 +101,12 @@ pipeline {
sh 'bash test/plugin/run.sh undertow-scenario'
}
}

stage('jedis 2.4.0-2.9.0 (18)') {
steps {
sh 'bash test/plugin/run.sh jedis-scenario'
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion docs/en/guides/Plugin-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,13 @@ spring async 4.3.x-5.1.x | 35 | 967.70
mongodb 3.4.0-3.11.1 | 17 | 1465.63

### Workload 4
#### Group 1 (1778.45s)
#### Group 1 (2397.45s)
scenario name | versions | elapsed time (sec)
---|---|---
kafka 0.11.0.0-2.3.0 | 16 | 704.75
ehcache 2.8.x-2.10.x | 19 | 440.71
undertow 1.3.0-2.0.27 | 23 | 633.00
jedis 2.4.0-2.9.0 | 18 | 619

#### Group 2 (2148.155s)
scenario name | versions | elapsed time (sec)
Expand Down
22 changes: 22 additions & 0 deletions test/plugin/scenarios/jedis-scenario/bin/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# 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.

home="$(cd "$(dirname $0)"; pwd)"

java -jar ${agent_opts} -Dredis.host=${REDIS_HOST} -Dredis.port=${REDIS_PORT} \
${home}/../libs/jedis-scenario.jar &
111 changes: 111 additions & 0 deletions test/plugin/scenarios/jedis-scenario/config/expectedData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# 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.

registryItems:
applications:
- {jedis-scenario: 2}
instances:
- {jedis-scenario: 1}
operationNames:
- jedis-scenario: [Jedis/set, Jedis/echo, Jedis/del,
Jedis/get, /jedis-scenario/case/jedis-scenario]
heartbeat: []
segmentItems:
- applicationCode: jedis-scenario
segmentSize: gt 1
segments:
- segmentId: not null
spans:
- operationName: Jedis/echo
operationId: 0
parentSpanId: 0
spanId: 1
spanLayer: Cache
startTime: nq 0
endTime: nq 0
componentId: 30
componentName: ''
isError: false
spanType: Exit
peer: redis-server:6379
peerId: 0
tags:
- {key: db.type, value: Redis}
- {key: db.statement, value: echo Test}
- operationName: Jedis/set
operationId: 0
parentSpanId: 0
spanId: 2
spanLayer: Cache
startTime: nq 0
endTime: nq 0
componentId: 30
componentName: ''
isError: false
spanType: Exit
peer: redis-server:6379
peerId: 0
tags:
- {key: db.type, value: Redis}
- {key: db.statement, value: set a}
- operationName: Jedis/get
operationId: 0
parentSpanId: 0
spanId: 3
spanLayer: Cache
startTime: nq 0
endTime: nq 0
componentId: 30
componentName: ''
isError: false
spanType: Exit
peer: redis-server:6379
peerId: 0
tags:
- {key: db.type, value: Redis}
- {key: db.statement, value: get a}
- operationName: Jedis/del
operationId: 0
parentSpanId: 0
spanId: 4
spanLayer: Cache
startTime: nq 0
endTime: nq 0
componentId: 30
componentName: ''
isError: false
spanType: Exit
peer: redis-server:6379
peerId: 0
tags:
- {key: db.type, value: Redis}
- {key: db.statement, value: del a}
- operationName: /jedis-scenario/case/jedis-scenario
operationId: 0
parentSpanId: -1
spanId: 0
spanLayer: Http
startTime: nq 0
endTime: nq 0
componentId: 1
componentName: ''
isError: false
spanType: Entry
peer: ''
peerId: 0
tags:
- {key: url, value: 'http://localhost:8080/jedis-scenario/case/jedis-scenario'}
- {key: http.method, value: GET}
29 changes: 29 additions & 0 deletions test/plugin/scenarios/jedis-scenario/configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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: jvm
entryService: http://localhost:8080/jedis-scenario/case/jedis-scenario
healthCheck: http://localhost:8080/jedis-scenario/case/healthCheck
startScript: ./bin/startup.sh
framework: jedis-scenario
environment:
- REDIS_HOST=redis-server
- REDIS_PORT=6379
dependencies:
redis-server:
image: redis:3.2.9-alpine
hostname: redis-server

108 changes: 108 additions & 0 deletions test/plugin/scenarios/jedis-scenario/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>jedis-scenario</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<modelVersion>4.0.0</modelVersion>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>
<test.framework.version>2.9.0</test.framework.version>
<spring-boot-version>2.1.6.RELEASE</spring-boot-version>
</properties>

<name>skywalking-jedis-scenario</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot-version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>${test.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>

<build>
<finalName>jedis-scenario</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.9.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.version}</source>
<target>${compiler.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assemble</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>./target/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<formats>
<format>zip</format>
</formats>

<fileSets>
<fileSet>
<directory>./bin</directory>
<fileMode>0775</fileMode>
</fileSet>
</fileSets>

<files>
<file>
<source>${project.build.directory}/jedis-scenario.jar</source>
<outputDirectory>./libs</outputDirectory>
<fileMode>0775</fileMode>
</file>
</files>
</assembly>
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.
*
*/

package org.apache.skywalking.apm.testcase.jedis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
public class Application {

public static void main(String[] args) {
try {
SpringApplication.run(Application.class, args);
} catch (Exception e) {
// Never do this
}
}
}
Loading

0 comments on commit 48bcac2

Please sign in to comment.