Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yanghaoyuan.sh
DolphinScheduler
提交
3c8e7dd5
DolphinScheduler
项目概览
yanghaoyuan.sh
/
DolphinScheduler
与 Fork 源项目一致
Fork自
apache / DolphinScheduler
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
DolphinScheduler
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3c8e7dd5
编写于
10月 15, 2021
作者:
K
Kirs
提交者:
GitHub
10月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[2.0-prepare]delete microbench module (#6532)
* [2.0-prepare]delete microbench module
上级
3bd2b91d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
1 addition
and
517 deletion
+1
-517
.github/workflows/unit-test.yml
.github/workflows/unit-test.yml
+1
-1
dolphinscheduler-microbench/pom.xml
dolphinscheduler-microbench/pom.xml
+0
-105
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/base/AbstractBaseBenchmark.java
...lphinscheduler/microbench/base/AbstractBaseBenchmark.java
+0
-123
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/EnumBenchMark.java
...che/dolphinscheduler/microbench/common/EnumBenchMark.java
+0
-112
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/IUserService.java
...ache/dolphinscheduler/microbench/common/IUserService.java
+0
-31
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/RpcTest.java
...rg/apache/dolphinscheduler/microbench/common/RpcTest.java
+0
-77
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/UserCallback.java
...ache/dolphinscheduler/microbench/common/UserCallback.java
+0
-30
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/UserService.java
...pache/dolphinscheduler/microbench/common/UserService.java
+0
-37
pom.xml
pom.xml
+0
-1
未找到文件。
.github/workflows/unit-test.yml
浏览文件 @
3c8e7dd5
...
...
@@ -85,7 +85,7 @@ jobs:
-Dsonar.core.codeCoveragePlugin=jacoco
-Dsonar.projectKey=apache-dolphinscheduler
-Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682
-Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js
,dolphinscheduler-microbench/src/**/*
-Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
...
...
dolphinscheduler-microbench/pom.xml
已删除
100644 → 0
浏览文件 @
3bd2b91d
<?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"
>
<parent>
<artifactId>
dolphinscheduler
</artifactId>
<groupId>
org.apache.dolphinscheduler
</groupId>
<version>
2.0.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
dolphinscheduler-microbench
</artifactId>
<packaging>
jar
</packaging>
<name>
${project.artifactId}
</name>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<jmh.version>
1.21
</jmh.version>
<javac.target>
1.8
</javac.target>
<uberjar.name>
benchmarks
</uberjar.name>
</properties>
<dependencies>
<dependency>
<groupId>
org.openjdk.jmh
</groupId>
<artifactId>
jmh-core
</artifactId>
<version>
${jmh.version}
</version>
</dependency>
<dependency>
<groupId>
org.openjdk.jmh
</groupId>
<artifactId>
jmh-generator-annprocess
</artifactId>
<version>
${jmh.version}
</version>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.dolphinscheduler
</groupId>
<artifactId>
dolphinscheduler-remote
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
${maven-compiler-plugin.version}
</version>
<configuration>
<compilerVersion>
${javac.target}
</compilerVersion>
<source>
${javac.target}
</source>
<target>
${javac.target}
</target>
<useIncrementalCompilation>
false
</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-assembly-plugin
</artifactId>
<version>
${maven-assembly-plugin.version}
</version>
<configuration>
<archive>
<manifest>
<mainClass>
org.openjdk.jmh.Main
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/base/AbstractBaseBenchmark.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.base
;
import
org.junit.Test
;
import
org.openjdk.jmh.annotations.*
;
import
org.openjdk.jmh.results.format.ResultFormatType
;
import
org.openjdk.jmh.runner.Runner
;
import
org.openjdk.jmh.runner.options.ChainedOptionsBuilder
;
import
org.openjdk.jmh.runner.options.OptionsBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.File
;
import
java.io.IOException
;
/**
* BaseBenchMark
* If you need to test jmh, please extend him first
*/
@Warmup
(
iterations
=
AbstractBaseBenchmark
.
DEFAULT_WARMUP_ITERATIONS
)
@Measurement
(
iterations
=
AbstractBaseBenchmark
.
DEFAULT_MEASURE_ITERATIONS
)
@State
(
Scope
.
Thread
)
@Fork
(
AbstractBaseBenchmark
.
DEFAULT_FORKS
)
public
abstract
class
AbstractBaseBenchmark
{
static
final
int
DEFAULT_WARMUP_ITERATIONS
=
10
;
static
final
int
DEFAULT_MEASURE_ITERATIONS
=
10
;
static
final
int
DEFAULT_FORKS
=
2
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AbstractBaseBenchmark
.
class
);
private
ChainedOptionsBuilder
newOptionsBuilder
()
{
String
className
=
getClass
().
getSimpleName
();
ChainedOptionsBuilder
optBuilder
=
new
OptionsBuilder
()
// set benchmark ClassName
.
include
(
className
);
if
(
getMeasureIterations
()
>
0
)
{
optBuilder
.
warmupIterations
(
getMeasureIterations
());
}
if
(
getMeasureIterations
()
>
0
)
{
optBuilder
.
measurementIterations
(
getMeasureIterations
());
}
if
(
getForks
()
>
0
)
{
optBuilder
.
forks
(
getForks
());
}
String
output
=
getReportDir
();
if
(
output
!=
null
)
{
boolean
writeFileStatus
;
String
filePath
=
getReportDir
()
+
className
+
".json"
;
File
file
=
new
File
(
filePath
);
if
(
file
.
exists
())
{
writeFileStatus
=
file
.
delete
();
}
else
{
writeFileStatus
=
file
.
getParentFile
().
mkdirs
();
try
{
writeFileStatus
=
file
.
createNewFile
();
}
catch
(
IOException
e
)
{
logger
.
warn
(
"jmh test create file error"
+
e
);
}
}
if
(
writeFileStatus
)
{
optBuilder
.
resultFormat
(
ResultFormatType
.
JSON
)
.
result
(
filePath
);
}
}
return
optBuilder
;
}
@Test
public
void
run
()
throws
Exception
{
new
Runner
(
newOptionsBuilder
().
build
()).
run
();
}
private
int
getWarmupIterations
()
{
String
value
=
System
.
getProperty
(
"warmupIterations"
);
return
null
!=
value
?
Integer
.
parseInt
(
value
)
:
-
1
;
}
private
int
getMeasureIterations
()
{
String
value
=
System
.
getProperty
(
"measureIterations"
);
return
null
!=
value
?
Integer
.
parseInt
(
value
)
:
-
1
;
}
private
static
String
getReportDir
()
{
return
System
.
getProperty
(
"perfReportDir"
);
}
private
static
int
getForks
()
{
String
value
=
System
.
getProperty
(
"forkCount"
);
return
null
!=
value
?
Integer
.
parseInt
(
value
)
:
-
1
;
}
}
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/EnumBenchMark.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.common
;
import
org.apache.dolphinscheduler.microbench.base.AbstractBaseBenchmark
;
import
org.openjdk.jmh.annotations.*
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
*Enum values JMH test
*/
@Warmup
(
iterations
=
2
,
time
=
1
)
@Measurement
(
iterations
=
4
,
time
=
1
)
@State
(
Scope
.
Benchmark
)
public
class
EnumBenchMark
extends
AbstractBaseBenchmark
{
@Benchmark
public
boolean
simpleTest
(){
return
Boolean
.
TRUE
;
}
@Param
({
"101"
,
"108"
,
"103"
,
"104"
,
"105"
,
"103"
})
private
int
testNum
;
@Benchmark
@BenchmarkMode
(
Mode
.
AverageTime
)
@OutputTimeUnit
(
TimeUnit
.
MICROSECONDS
)
public
void
enumValuesTest
()
{
TestTypeEnum
.
oldGetNameByType
(
testNum
);
}
@Benchmark
@BenchmarkMode
(
Mode
.
AverageTime
)
@OutputTimeUnit
(
TimeUnit
.
MICROSECONDS
)
public
void
enumStaticMapTest
()
{
TestTypeEnum
.
newGetNameByType
(
testNum
);
}
public
enum
TestTypeEnum
{
TYPE_101
(
101
,
"TYPE101"
),
TYPE_102
(
102
,
"TYPE102"
),
TYPE_103
(
103
,
"TYPE103"
),
TYPE_104
(
104
,
"TYPE104"
),
TYPE_105
(
105
,
"TYPE105"
),
TYPE_106
(
106
,
"TYPE106"
),
TYPE_107
(
107
,
"TYPE107"
),
TYPE_108
(
108
,
"TYPE108"
);
private
int
code
;
private
String
name
;
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
TestTypeEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
private
static
final
Map
<
Integer
,
TestTypeEnum
>
TEST_TYPE_MAP
=
new
HashMap
<>();
static
{
for
(
TestTypeEnum
testTypeEnum
:
TestTypeEnum
.
values
())
{
TEST_TYPE_MAP
.
put
(
testTypeEnum
.
code
,
testTypeEnum
);
}
}
public
static
void
newGetNameByType
(
int
code
)
{
if
(
TEST_TYPE_MAP
.
containsKey
(
code
))
{
TEST_TYPE_MAP
.
get
(
code
);
return
;
}
throw
new
IllegalArgumentException
(
"invalid code : "
+
code
);
}
public
static
void
oldGetNameByType
(
int
code
)
{
for
(
TestTypeEnum
testTypeEnum
:
TestTypeEnum
.
values
())
{
if
(
testTypeEnum
.
getCode
()
==
code
)
{
return
;
}
}
throw
new
IllegalArgumentException
(
"invalid code : "
+
code
);
}
}
}
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/IUserService.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.common
;
import
org.apache.dolphinscheduler.rpc.base.Rpc
;
/**
* IUserService
*/
public
interface
IUserService
{
@Rpc
(
async
=
true
,
serviceCallback
=
UserCallback
.
class
,
retries
=
9999
)
Boolean
say
(
String
s
);
Integer
hi
(
int
num
);
}
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/RpcTest.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.common
;
import
org.apache.dolphinscheduler.microbench.base.AbstractBaseBenchmark
;
import
org.apache.dolphinscheduler.remote.config.NettyServerConfig
;
import
org.apache.dolphinscheduler.remote.utils.Host
;
import
org.apache.dolphinscheduler.rpc.client.IRpcClient
;
import
org.apache.dolphinscheduler.rpc.client.RpcClient
;
import
org.apache.dolphinscheduler.rpc.remote.NettyClient
;
import
org.apache.dolphinscheduler.rpc.remote.NettyServer
;
import
java.util.concurrent.TimeUnit
;
import
org.openjdk.jmh.annotations.Benchmark
;
import
org.openjdk.jmh.annotations.BenchmarkMode
;
import
org.openjdk.jmh.annotations.Measurement
;
import
org.openjdk.jmh.annotations.Mode
;
import
org.openjdk.jmh.annotations.OutputTimeUnit
;
import
org.openjdk.jmh.annotations.Scope
;
import
org.openjdk.jmh.annotations.Setup
;
import
org.openjdk.jmh.annotations.State
;
import
org.openjdk.jmh.annotations.TearDown
;
import
org.openjdk.jmh.annotations.Warmup
;
@Warmup
(
iterations
=
5
,
time
=
1
)
@Measurement
(
iterations
=
10
,
time
=
1
)
@State
(
Scope
.
Benchmark
)
@BenchmarkMode
({
Mode
.
Throughput
,
Mode
.
AverageTime
,
Mode
.
SampleTime
})
public
class
RpcTest
extends
AbstractBaseBenchmark
{
private
NettyServer
nettyServer
;
private
IUserService
userService
;
private
Host
host
;
private
IRpcClient
rpcClient
=
new
RpcClient
();
@Setup
public
void
before
()
throws
Exception
{
nettyServer
=
new
NettyServer
(
new
NettyServerConfig
());
IRpcClient
rpcClient
=
new
RpcClient
();
host
=
new
Host
(
"127.0.0.1"
,
12346
);
userService
=
rpcClient
.
create
(
IUserService
.
class
,
host
);
}
@Benchmark
@BenchmarkMode
({
Mode
.
Throughput
,
Mode
.
AverageTime
,
Mode
.
SampleTime
})
@OutputTimeUnit
(
TimeUnit
.
MILLISECONDS
)
public
void
sendTest
()
throws
Exception
{
userService
=
rpcClient
.
create
(
IUserService
.
class
,
host
);
Integer
result
=
userService
.
hi
(
1
);
}
@TearDown
public
void
after
()
{
NettyClient
.
getInstance
().
close
();
nettyServer
.
close
();
}
}
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/UserCallback.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.common
;
import
org.apache.dolphinscheduler.rpc.common.AbstractRpcCallBack
;
/**
* UserCallback
*/
public
class
UserCallback
extends
AbstractRpcCallBack
{
@Override
public
void
run
(
Object
object
)
{
}
}
dolphinscheduler-microbench/src/main/java/org/apache/dolphinscheduler/microbench/common/UserService.java
已删除
100644 → 0
浏览文件 @
3bd2b91d
/*
* 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.dolphinscheduler.microbench.common
;
import
org.apache.dolphinscheduler.rpc.base.RpcService
;
/**
* UserService
*/
@RpcService
(
"IUserService"
)
public
class
UserService
implements
IUserService
{
@Override
public
Boolean
say
(
String
s
)
{
return
true
;
}
@Override
public
Integer
hi
(
int
num
)
{
return
++
num
;
}
}
pom.xml
浏览文件 @
3c8e7dd5
...
...
@@ -1231,7 +1231,6 @@
<module>
dolphinscheduler-dist
</module>
<module>
dolphinscheduler-remote
</module>
<module>
dolphinscheduler-service
</module>
<module>
dolphinscheduler-microbench
</module>
<module>
dolphinscheduler-standalone-server
</module>
</modules>
</project>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录