Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,29 @@ dmypy.json

# Pyre type checker
.pyre/

.DS_Store

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
4 changes: 4 additions & 0 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ In the container, you can generate and run ctests as shown below.

Run `./setup_ubuntu.sh` or `sudo ./setup_ubuntu.sh`.

For Apache Skywalking Project - Run `sudo ./setup_ubuntu_skywalking.sh`

### 2. Target Project

To generate ctests or run ctest, you need to first clone the target project.
Expand All @@ -61,6 +63,8 @@ To generate ctests or run ctest, you need to first clone the target project.

`<main project>` can be `hadoop`, `hbase`, `zookeeper` or `alluxio`.

For Apache Skywalking Project - Run `./add_project_skywalking.sh -r <skwywalking_release_version>`

## Usage

### 1. Generating Ctests
Expand Down
36 changes: 36 additions & 0 deletions core/add_project_skywalking.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

while getopts r: flag
do
case "${flag}" in
r) version=${OPTARG};;
esac
done

if [ -z "$version" ]
then
echo "Usage : ./add_project_skywalking.sh -r <release_version>"
exit
fi

echo $version

rm -rf app/skywalking

mkdir -p app/skywalking

cd app/skywalking

wget https://dlcdn.apache.org/skywalking/$version/apache-skywalking-apm-$version-src.tgz

tar zxvf apache-skywalking-apm-$version-src.tgz

cd apache-skywalking-apm-$version

git apply ../../../patch/skywalking/skywalking.patch

cd oap-server

mvn clean install -DskipTests

cd ..
46 changes: 46 additions & 0 deletions core/default_configs/skywalking-default.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
configuration.apollo.apolloEnv DEV Configure appolo environment
services[1].duration 20000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
configuration.nacos.port 49317 Nacos Server Port
configuration.zookeeper.hostPort localhost:49315 Zookeeper host port
configuration.nacos.username nacos Nacos auth username
configuration.nacos.port 49319 Nacos Server Port
storage.mysql.metadataQueryMaxSize 5000 Metadata query max size
configuration.apollo.period 1 Unit seconds sync period default fetch every 60 seconds
configuration.nacos.period 2 Unit seconds sync period default fetch every 60 seconds
configuration.nacos.accessKey Nacos auth accessKey
configuration.consul.period 1 Sync period in seconds. Defaults to 60 seconds.
configuration.etcd.period 1 Unit seconds sync period default fetch every 60 seconds
configuration.zookeeper.maxRetries 3 max number of times to retry
configuration.apollo.apolloCluster default Apollo cluster name
configuration.zookeeper.hostPort localhost:49310 Zookeeper host port
core.default.enableDataKeeperExecutor TRUE Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
default.rate 10000 The sample rate precision is 1/10000. 10000 means 100% sample in default
receiver-zipkin.default.restPort 9411 Port used by OAP to collect zipkin trace from HTTP
services[1].name name1 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
services[0].rate 2000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
MO-1.MO-1-P1.prop2 value2-prop Example configs
MO-1.MO-1-P1.p1 value1 Example configs
configuration.consul.hostAndPorts localhost:49296 Consul host and ports separated by comma eg 1.2.3.4:8500,2.3.4.5:8500
configuration.zookeeper.namespace /default Zookeeper namespace
configuration.nacos.secretKey Nacos auth accessKey
configuration.apollo.appId SampleApp Apollo application id
storage.mysql.properties.jdbcUrl jdbc:mysql://localhost:3306/swtest?rewriteBatchedStatements Mysql jdbc connection string
configuration.nacos.serverAddr localhost Nacos Server Host
configuration.etcd.endpoints http://127.0.0.1:49305 Etcd Server Host
services[1].rate 1000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
configuration.nacos.group skywalking Nacos Configuration Group
configuration.apollo.apolloMeta http://localhost:49284 Apollo host and port
configuration.etcd.endpoints http://127.0.0.1:49302 Etcd Server Host
services[0].name name2 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
configuration.zookeeper.baseSleepTimeMs 1000 initial amount of time to wait between retries
storage.mysql.properties.dataSource.password !AI!3B Mysql datasource password
configuration.apollo.apolloMeta http://localhost:49287 Apollo host and port
default.duration -1 The sample rate precision is 1/10000. 10000 means 100% sample in default
configuration.consul.hostAndPorts localhost:49290 localhost:49296 Consul host and ports separated by comma eg 1.2.3.4:8500,2.3.4.5:8500
receiver-zipkin.default.restHost 0.0.0.0 Host used by OAP to collect zipkin trace from HTTP
configuration.nacos.namespace Nacos Configuration namespace
configuration.nacos.password nacos Nacos auth username
MO-1.MO-1-P1.p2 value2 Example configs
services[0].duration 30000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
configuration.zookeeper.period 1 Unit seconds sync period default fetch every 60 seconds
configuration.etcd.namespace /skywalking/ Etcd Configuration Group
100 changes: 100 additions & 0 deletions core/generate_ctest/ctest_mapping/ctests-skywalking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
{
"configuration.apollo.period": [
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated4Group"
],
"configuration.zookeeper.maxRetries": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
],
"configuration.zookeeper.period": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
],
"configuration.zookeeper.baseSleepTimeMs": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
],
"configuration.zookeeper.namespace": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
],
"services[1].rate": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"services[0].duration": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"default.duration": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"services[0].rate": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"default.rate": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"services[1].duration": [
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
],
"configuration.nacos.port": [
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
],
"configuration.nacos.group": [
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
],
"configuration.nacos.period": [
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
],
"configuration.etcd.period": [
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated4Group"
],
"configuration.etcd.namespace": [
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated4Group"
],
"configuration.consul.period": [
"org.apache.skywalking.oap.server.configuration.consul.ITConsulConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.consul.ITConsulConfigurationTest#shouldReadUpdated4Group"
]
}
52 changes: 52 additions & 0 deletions core/generate_ctest/skywalking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Generating Parameter Sets for Apache Skywalking

**generate_ctest is used to automatically generate ctests**

```shell
# Switch to the generate_ctest/skywalking directory
cd <openctest dir>/core/generate_ctest/skywalking

# Build the project to generate the target/ctest-runner-1.0-SNAPSHOT-jar-with-dependencies.jar
mvn clean package

# Switch to the instrumented apache skywalking directory
cd /home/skywalking

# Run the jar by providing the following inputs
# 1. temp directory which will contain the files needed for this run
# 2. File core/identify_param/results/skywalking/test_to_param_flat.json from the execution of the core/identify_param/skywalking step
# 3. File skywalking-generated-values.tsv from the execution of the core/generate_value step
# 4. Result directory which will contain the results of the execution
java -jar <openctest dir>/core/generate_ctest/skywalking/target/ctest-runner-1.0-SNAPSHOT-jar-with-dependencies.jar <dir>/tmp <dir>/test-to-config-flat.txt <dir>/skywalking-generated-values.tsv <dir>/resultDir
```

## Results

2 files are generated as a result of this run

1. Generates the `core/generate_ctest/ctest_mapping/ctests-skywalking.json` file
```json
{
"configuration.apollo.period": [
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated4Group"
],
"configuration.zookeeper.maxRetries": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
],
"configuration.zookeeper.period": [
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
]...
}

```

2. Execution results for each case in the tab separated format

Param Test Value p/f Time_in_ns
```json
services[0].duration org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify 15000 p 9188519779
services[0].duration org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify 60000 p 9179170267
```
62 changes: 62 additions & 0 deletions core/generate_ctest/skywalking/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>org.uiuc</groupId>
<artifactId>ctest-runner</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>com.anubhavshukla</groupId>
<artifactId>properties-to-yaml-converter</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>org.uiuc.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Loading