Skip to content
Merged
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 build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,4 @@ signing {
println 'Used useInMemoryPgpKeys()'
}
}

24 changes: 24 additions & 0 deletions examples/benchmarking/BenchmarkingREADME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Benchmarking results

This benchmarking module is provided for maintainers, allowing them to check that their changes have not degraded performance. It uses the Java microbenchmarking harness, JMH.

The benchmark test measures the time taken to track one event. Note that this does not include the time for the event to be processed and sent, which happens asynchronously.

To run the test, navigate to this folder and run:

```bash
$ ./gradlew build
$ ./gradlew jmh
```

The tracker version is set in the `build.gradle` file. Change the specified version to benchmark a different tracker version.
```groovy
dependencies {
jmh 'com.snowplowanalytics:snowplow-java-tracker:0.11.0'
}
```
Note that you may also need to edit the `TrackerBenchmark` `closeThreads()` code. Versions from 0.12.0 onwards must call a different method. This is explained in in-line comments.

### Results
See this PR for discussion of benchmarking results: https://github.com/snowplow/snowplow-java-tracker/pull/301

37 changes: 37 additions & 0 deletions examples/benchmarking/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2014-2021 Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/

import org.gradle.api.tasks.JavaExec

plugins {
id 'java'
id "me.champeau.jmh" version "0.6.6"
}

group 'com.snowplowanalytics'
version '1.0'

repositories {
mavenLocal {
content {
includeGroup "com.snowplowanalytics"
}
}
mavenCentral()
}


dependencies {
jmh 'com.snowplowanalytics:snowplow-java-tracker:0.10.1'
}

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
185 changes: 185 additions & 0 deletions examples/benchmarking/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions examples/benchmarking/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/benchmarking/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'benchmarking'

Loading