Skip to content

Commit

Permalink
Updating configuration file and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
emasliukovas committed Apr 15, 2021
1 parent c6461b4 commit 241c669
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 30 deletions.
70 changes: 45 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
# What is CyBench
# What is CyBench Benchmarks

**CyBench** is a Java Benchmark based on [JMH](https://openjdk.java.net/projects/code-tools/jmh/), designed to help developers build high performance Java apps.
**CyBench Benchmarks** java based benchmarks that uses [CyBench Launcher](https://github.com/K2NIO/gocypher-cybench-java) to execute JMH based benchmarks. It's designed to help developers build high performance Java apps.
Speed-test Java classes, collections, modules, libraries and other application building blocks under varying runtime conditions.
Share your results with the community, compare and choose the right libraries for your application. **CyBench** helps you be a better developer.

Download and run CyBench [here](https://www.gocypher.com/cybench/downloads).
Download and run CyBench Benchmarks [here](https://github.com/K2NIO/gocypher-cybench-java-core/releases).

Check out the benchmarks from other users and analyze your results here [here](https://app.cybench.io/cybench/).

# Running User-defined Benchmarks using CyBench
## Running Default Benchmarks using CyBench

## CyBench Launcher
- Download the selected benchmark package from the [release page](https://github.com/K2NIO/gocypher-cybench-java-core/releases)
- Extract the files and run cybench.bat (on Windows) or cybench.sh (on Unix).
- Analyze results in your console, reports folder or [app.cybench.io](https://app.cybench.io/cybench/)
- **Otional:** manage your benchmarking run configuration located in `<cybench-home>/conf/cybench-launcher.properties`

The CyBench Launcher contains a set of performance tests developed by the CyBench team to benchmark Java Core services. These tests are are executed by default every time CyBench benchmark is executed via `benchmark_run` script and results are automatically submitted to a public [CyBench Repository](https://www.gocypher.com/cybench/).
Default benchmark execution and automated reporting can be configured via `<cybench-home>/conf/cybench-launcher.properties`
#### CyBench launcher configuration

### CyBench launcher configuration
| Property name | Description | Default value |
| ------------- |-------------| -----:|
| **javaOptions** | All the property fields that starts with name javaOptions will be used while benchmarking as JVM properties. | - |
| **javaToUsePath** | Provide full path to java.exe to be used e.g. D:/jdk180_162/bin/java.exe | - |
| **benchmarks**| Provide jar's with JMH benchmarks which shall be executed with CyBench. [more here](adding-custom-benchmarks-for-execution)| - |
| **sendReport**| Choose if the report generated will be automatically uploaded. (true/false) | true |
| **reportUploadStatus**| Define public or private property for the uploaded report visibility. | public |
| **benchAccessToken** | By providing the "bench" token that you get after creating a workspace in CyBench UI, you can send reports to your private directory, which will be visible only to the users that you authorize. | - |
| **emailAddress** | Email property is used to identify report sender while sending reports to both private and public repositories | - |
| **reportName**| Choose the uploaded report name. E.g. | - |
| **benchmarkClasses**| Specify benchmarks by including fully qualified benchmark class names which are comma separated. For more information [more here](#execute-only-custom-benchmarks)| - |
| **numberOfBenchmarkForks**| Number of separate full executions of a benchmark (warm up+measurement), this is returned still as one primary score item. | 1 |
| **measurementIterations** | Number of measurements per benchmark operation, this is returned still as one primary score item. | 5 |
| **warmUpIterations**| Number of iterations executed for warm up. | 1 |
| **warmUpSeconds**| Number of seconds dedicated for each warm up iteration. | 5 |
| **runThreadCount**| Number of threads for benchmark test execution. | 1 |
| **benchmarkMetadata**| A property which adds extra properties to the benchmarks report such as category or version or context. Configuration pattern is `<fully qualified benchmark class name>=<key1>:<value1>;<key2>:<value2>`. Example which adds category for class CollectionsBenchmarks: `com.gocypher.benchmarks.client.CollectionsBenchmarks=category:Collections;` | - |
| **userProperties**| User defined properties which will be added to benchmarks report section `environmentSettings->userDefinedProperties` as key/value strings. Configuration pattern:`<key1>:<value1>;<key2>:<value2>`. Example which adds a project name:`user.propname1=My Test Project;` | - |

Configuration located in file `<cybench-home>/conf/cybench-launcher.properties`

TBD.

### Add Your Benchmark to CyBench Launcher

Attachment and execution of user-defined benchmarks using CyBench launcher:
* Build a `jar` file with your benchmarks containing `jmh` compiled classes and dependecies
* Copy benchmark `jar` file to `<cybench-home>` (where `gocypher-benchmarks-client.jar` resides)
* Configure CyBench Launcher to execute your benchmarks

**NOTE**:
* User defined benchmarks must be implemented using `JMH` framework
* Exported `jar` must contain `class` files generated by `JMH` framework (`jar` file must contain a folder `jmh_generated` with classes having `jmh` suffix ).
* If any files are created during tests (test data files, results files) run they must be deleted after the iteration when benchmark finishes

### Running User Defined JMH Benchmarks
### Adding Custom Benchmarks for Execution

Update CyBench Launcher configuration located in `<cybench-home>/conf/cybench-launcher.properties`:

Expand Down Expand Up @@ -61,7 +66,7 @@ Update CyBench Launcher configuration located in `<cybench-home>/conf/cybench-la
benchmarkMetadata=com.gocypher.benchmarks.client.CollectionsBenchmarks=category:Collections;
```

### Execute Specific Benchmarks
### Execute Only Custom Benchmarks

Update CyBench configuration in order to run specific JMH tests:
* add or update property `benchmarkClasses`, specify class names of tests which shall be executed (values must be comma separated).
Expand All @@ -75,3 +80,18 @@ Update CyBench configuration in order to run specific JMH tests:
benchmarkClasses=com.gocypher.benchmarks.client.CollectionsBenchmarks,NumberBenchmarks
```


## Running User-defined Benchmarks using CyBench

### Add Your Benchmark to CyBench Launcher

Attachment and execution of user-defined benchmarks using CyBench launcher:
* Build a `jar` file with your benchmarks containing `jmh` compiled classes and dependecies
* Copy benchmark `jar` file to `<cybench-home>` (where `gocypher-benchmarks-client.jar` resides)
* Configure CyBench Launcher to execute your benchmarks

**NOTE**:
* User defined benchmarks must be implemented using `JMH` framework
* Exported `jar` must contain `class` files generated by `JMH` framework (`jar` file must contain a folder `jmh_generated` with classes having `jmh` suffix ).
* If any files are created during tests (test data files, results files) run they must be deleted after the iteration when benchmark finishes

Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,17 @@ javaToUsePath=
### Provide jar's with JMH benchmarks which shall be executed with CyBench
benchmarks=

### Benchmarks activity configuration properties ###
### Choose if the report generated will be automatically uploaded
sendReport=true
### Define public or private property for the uploaded report visibility
reportUploadStatus=public
### For registered users only:
# provide the bench token from your user window for the results to be visible separately in your private repository
benchAccessToken=
# provide the email address if you want the reports to be identified as sent by you and get achievement points
emailAddress=

### Benchmarks activity configuration properties ###
### Choose if the report generated will be automatically uploaded
sendReport=true
### Define public or private property for the uploaded report visibility
reportUploadStatus=public
### Choose the uploaded report name ( Can be leaved empty if not required ).
reportName=
### Uncomment to execute only the selected benchmarks.
Expand Down

0 comments on commit 241c669

Please sign in to comment.