Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature:seata benchmark #6580

Open
wants to merge 12 commits into
base: 2.x
Choose a base branch
from
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
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<module>server</module>
<module>ext/apm-seata-skywalking-plugin</module>
<module>integration-tx-api</module>
<module>seata-benchmark</module>
<!--<module>seata-plugin</module>-->
</modules>

Expand Down
37 changes: 37 additions & 0 deletions seata-benchmark/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.seata</groupId>
<artifactId>seata-parent</artifactId>
<version>${revision}</version>
</parent>

<artifactId>seata-benchmark</artifactId>
<packaging>pom</packaging>
<modules>
<module>seata-benchmark-baseline</module>
<module>seata-benchmark-profiler</module>
</modules>

</project>
90 changes: 90 additions & 0 deletions seata-benchmark/seata-benchmark-baseline/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.seata</groupId>
<artifactId>seata-benchmark</artifactId>
<version>${revision}</version>
</parent>

<artifactId>seata-benchmark-baseline</artifactId>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jmh.version>1.21</jmh.version>
</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>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-all</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>seata-server</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<artifactId>hessian</artifactId>
<groupId>com.alipay.sofa</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.5.3</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<parameters>true</parameters>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*
* 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.seata.benchmark.baseline;

import java.util.Map;

public class BenchMarkModel {

private String benchmark;

private String mode;

private Integer warmupIterations;

private String warmupTime;

private Integer measurementIterations;

private String measurementTime;

private PrimaryMetric primaryMetric;

private Map<String, String> params;


public static class PrimaryMetric {

/**
* score
*/
private Double score;

/**
* sample time
*/
private Map<String, Double> scorePercentiles;

private String scoreUnit;

public double getScore() {
return score;
}

public void setScore(Double score) {
this.score = score;
}

public Map<String, Double> getScorePercentiles() {
return scorePercentiles;
}

public void setScorePercentiles(Map<String, Double> scorePercentiles) {
this.scorePercentiles = scorePercentiles;
}

public String getScoreUnit() {
return scoreUnit;
}

public void setScoreUnit(String scoreUnit) {
this.scoreUnit = scoreUnit;
}
}

public String getBenchmark() {
return benchmark;
}

public void setBenchmark(String benchmark) {
this.benchmark = benchmark;
}

public String getMode() {
return mode;
}

public void setMode(String mode) {
this.mode = mode;
}

public Integer getWarmupIterations() {
return warmupIterations;
}

public void setWarmupIterations(Integer warmupIterations) {
this.warmupIterations = warmupIterations;
}

public String getWarmupTime() {
return warmupTime;
}

public void setWarmupTime(String warmupTime) {
this.warmupTime = warmupTime;
}

public Integer getMeasurementIterations() {
return measurementIterations;
}

public void setMeasurementIterations(Integer measurementIterations) {
this.measurementIterations = measurementIterations;
}

public String getMeasurementTime() {
return measurementTime;
}

public void setMeasurementTime(String measurementTime) {
this.measurementTime = measurementTime;
}

public PrimaryMetric getPrimaryMetric() {
return primaryMetric;
}

public void setPrimaryMetric(PrimaryMetric primaryMetric) {
this.primaryMetric = primaryMetric;
}


public String getBenchmarkClassName() {
String fullClassName = this.benchmark.substring(0, benchmark.lastIndexOf('.'));

return fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
}

public String getBenchmarkMethodKey() {
String methodName = benchmark.substring(benchmark.lastIndexOf('.') + 1);
if (params == null || params.isEmpty()) {
return methodName;
}

//support benchmark param
StringBuilder stringBuilder = new StringBuilder(methodName);
for (Map.Entry<String, String> entry : params.entrySet()) {
stringBuilder.append("-");
stringBuilder.append(entry.getValue());
}
return stringBuilder.toString();
}

public Map<String, String> getParams() {
return params;
}
}
Loading