Skip to content

Commit

Permalink
Merge branch 'master' into jedis-scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-sheng committed Nov 9, 2019
2 parents 683c6a0 + cbe03da commit 948919c
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 112 deletions.
2 changes: 1 addition & 1 deletion docs/en/guides/Plugin-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ java -jar ${agent_opts} "-Dskywalking.agent.service_name=jettyclient-scenario"
We provided archetypes and a script to make creating a project easier. It creates a completed project of a test case. So that we only need to focus on cases.
First, we can use followed command to get usage about the script.

`bash ${SKYWALKING_HOME}/test/plugin/generator.sh -h`
`bash ${SKYWALKING_HOME}/test/plugin/generator.sh`

Then, runs and generates a project, named by `scenario_name`, in `./scenarios`.

Expand Down
4 changes: 2 additions & 2 deletions docs/en/setup/envoy/als_setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ You need three steps to open ALS.
```yaml
envoy-metric:
default:
alsHTTPAnalysis:
- k8s-mesh
alsHTTPAnalysis: "k8s-mesh"
```
Note multiple value,please use `,` symbol split

Notice, only use this when envoy under Istio controlled, also in k8s env.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<fileSet filtered="true" packaged="false">
<directory>config</directory>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/assembly</directory>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
</fileSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

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

java -jar ${agent_opts} ${home}/../libs${scenario_name}.jar &
java -jar ${agent_opts} ${home}/../libs/${scenario_name}.jar &
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ registryItems:
instances:
- {${scenario_name}: 1}
operationNames:
- canal-scenario: []
- ${scenario_name}: []
heartbeat: []
segmentItems:
- applicationCode: ${scenario_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,41 @@
<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">
<parent>
<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>${artifactId}</artifactId>
<version>1.0.0</version>
</parent>

<groupId>org.apache.skywalking.apm.testcase</groupId>
<artifactId>${artifactId}</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<modelVersion>4.0.0</modelVersion>

<artifactId>${scenario_name}</artifactId>
<properties>
<spring.version>4.3.8.RELEASE</spring.version>
<spring-boot-version>1.5.2.RELEASE</spring-boot-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>

<test.framework.version>YOUR VERSION</test.framework.version>

<spring-boot-version>2.1.6.RELEASE</spring-boot-version>
</properties>

<name>skywalking-${scenario_name}</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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
Expand All @@ -48,17 +64,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-version}</version>
</dependency>
</dependencies>

Expand All @@ -77,7 +82,33 @@
</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
Expand Up @@ -16,20 +16,20 @@
*
*/

package $package;
package ${package}.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RestController
@RequestMapping("/case")
@PropertySource("classpath:application.properties")
public class CaseController {

private static final Logger logger = LogManager.getLogger(CaseController.class);

private static final String SUCCESS = "Success";

@RequestMapping("/${scenario_case}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
# limitations under the License.
#
#

server.port=8080
server.contextPath=/${scenario_name}
logging.config=classpath:log4j2.xml
server:
port: 8080
servlet:
context-path: /${scenario_name}
logging:
config: classpath:log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/webapp</directory>
</fileSet>
</fileSets>
</archetype-descriptor>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ registryItems:
instances:
- {${scenario_name}: 1}
operationNames:
- canal-scenario: []
- ${scenario_name}: []
heartbeat: []
segmentItems:
- applicationCode: ${scenario_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

type: jvm
type: tomcat
entryService: http://localhost:8080/${scenario_name}/case/${scenario_case}
healthCheck: http://localhost:8080/${scenario_name}/case/healthCheck
framework: ${scenario_name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

<modelVersion>4.0.0</modelVersion>

<name>skywalking-${scenario_name}</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.version>1.8</compiler.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class CaseServlet extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// your codes
PrintWriter printWriter = resp.getWriter();
printWriter.write("success");
printWriter.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class HealthCheckServlet extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// your codes
PrintWriter writer = resp.getWriter();
writer.write("Success");
writer.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
~ limitations under the License.
~
-->
<Configuration status="info">
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%traceId] %-5p %c{1}:%L - %m%n"/>
<Console name="Console" target="SYSTEM_ERR">
<PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="OFF">
<Root level="WARN">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>skywalking-httpclient-scenario</display-name>
<display-name>skywalking-${scenario_name}</display-name>

<servlet>
<servlet-name>caseServlet</servlet-name>
Expand Down
Loading

0 comments on commit 948919c

Please sign in to comment.