Skip to content

Commit 8d00766

Browse files
committed
improve mise tasks
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 52722d2 commit 8d00766

File tree

13 files changed

+61
-76
lines changed

13 files changed

+61
-76
lines changed

.mise/tasks/.shellcheckrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# shellcheck configuration for mise tasks
2+
# SC2154: usage_* variables are set by mise framework
3+
disable=SC2154
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env bash
22

3+
#MISE description="Build release package"
4+
#MISE env={TAG = "1.5.0-SNAPSHOT"}
5+
36
set -euo pipefail
47

58
VERSION=${TAG#v}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
#MISE description="Make sure the BOM has all necessary modules"
23

34
set -euo pipefail
45

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python3
2+
3+
#MISE description="Run and update JMH benchmark outputs in the benchmarks module"
4+
25
"""
36
Run benchmarks for the `benchmarks` module, capture JMH text output, and update
47
any <pre>...</pre> blocks containing "thrpt" under the `benchmarks/` module
@@ -166,20 +169,6 @@ def main(argv: List[str]):
166169
parser.add_argument('--jmh-args', default='', help='Extra arguments to pass to the JMH main (e.g. "-f 1 -wi 0 -i 1")')
167170
args = parser.parse_args(argv)
168171

169-
# Determine repository root by searching upwards for a marker (mvnw or pom.xml).
170-
start_dir = os.path.abspath(os.path.dirname(__file__))
171-
repo_root = start_dir
172-
while True:
173-
if os.path.exists(os.path.join(repo_root, 'mvnw')) or os.path.exists(os.path.join(repo_root, 'pom.xml')):
174-
break
175-
parent = os.path.dirname(repo_root)
176-
if parent == repo_root:
177-
# reached filesystem root; fallback to original heuristic (one level up)
178-
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
179-
break
180-
repo_root = parent
181-
os.chdir(repo_root)
182-
183172
build_benchmarks(args.mvnw, args.module)
184173
jar = find_benchmarks_jar(args.module)
185174
output = run_jmh(jar, args.java, args.jmh_args)

scripts/set-release-version-github-pages.sh renamed to .mise/tasks/set-release-version-github-pages.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
#MISE description="Set release version in GitHub Pages quickstart.md"
4+
35
set -euox pipefail
46

57
version=$(git tag -l | grep 'v' | sort | tail -1 | sed 's/v//')

.mise/tasks/set-version.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
#MISE description="Update version in all pom.xml files"
4+
#USAGE arg "<version>" help="new version"
5+
6+
set -euo pipefail
7+
8+
# replace all occurrences '<version>1.5.0-SNAPSHOT</version>' with '<version>$usage_version</version>'
9+
# in all pom.xml files in the current directory and subdirectories
10+
11+
find . -name 'pom.xml' -exec \
12+
sed -i "s/<version>1.5.0-SNAPSHOT<\/version>/<version>$usage_version<\/version>/g" {} +
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
#MISE description="Run GitHub Super Linter on the repository"
4+
35
set -euo pipefail
46

57
pushd "$(dirname "$0")/.."

benchmarks/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Benchmarks
22

33
## How to Run
4+
5+
### Running benchmarks
6+
7+
Run benchmarks and update the results in the Javadoc of the benchmark classes:
8+
9+
```shell
10+
mise run run-benchmarks
11+
```
12+
13+
### Running benchmarks manually
414

515
```shell
616
java -jar ./benchmarks/target/benchmarks.jar

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,17 @@
2121
* Results on a machine with dedicated Core i7 1265U:
2222
*
2323
* <pre>
24-
*
25-
* Benchmark Mode Cnt Score Error Units
26-
* CounterBenchmark.codahaleIncNoLabels thrpt 25 32969.795 ± 1547.775 ops/s
27-
* CounterBenchmark.openTelemetryAdd thrpt 25 747.068 ± 93.128 ops/s
28-
* CounterBenchmark.openTelemetryInc thrpt 25 760.784 ± 47.595 ops/s
29-
* CounterBenchmark.openTelemetryIncNoLabels thrpt 25 824.346 ± 45.131 ops/s
30-
* CounterBenchmark.prometheusAdd thrpt 25 28403.000 ± 250.774 ops/s
31-
* CounterBenchmark.prometheusInc thrpt 25 38368.142 ± 361.914 ops/s
32-
* CounterBenchmark.prometheusNoLabelsInc thrpt 25 35558.069 ± 4020.926 ops/s
33-
* CounterBenchmark.simpleclientAdd thrpt 25 4081.152 ± 620.094 ops/s
34-
* CounterBenchmark.simpleclientInc thrpt 25 5735.644 ± 1205.329 ops/s
35-
* CounterBenchmark.simpleclientNoLabelsInc thrpt 25 6852.563 ± 544.481 ops/s
24+
* Benchmark Mode Cnt Score Error Units
25+
* CounterBenchmark.codahaleIncNoLabels thrpt 57881.585 ops/s
26+
* CounterBenchmark.openTelemetryAdd thrpt 9771.577 ops/s
27+
* CounterBenchmark.openTelemetryInc thrpt 9627.961 ops/s
28+
* CounterBenchmark.openTelemetryIncNoLabels thrpt 10303.562 ops/s
29+
* CounterBenchmark.prometheusAdd thrpt 31623.420 ops/s
30+
* CounterBenchmark.prometheusInc thrpt 54090.469 ops/s
31+
* CounterBenchmark.prometheusNoLabelsInc thrpt 50913.426 ops/s
32+
* CounterBenchmark.simpleclientAdd thrpt 4564.419 ops/s
33+
* CounterBenchmark.simpleclientInc thrpt 4645.809 ops/s
34+
* CounterBenchmark.simpleclientNoLabelsInc thrpt 4581.249 ops/s
3635
* </pre>
3736
*
3837
* Prometheus counters are faster than counters of other libraries. For example, incrementing a

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
* Results on a machine with dedicated Core i7 1265U:
2121
*
2222
* <pre>
23-
* Benchmark Mode Cnt Score Error Units
24-
* HistogramBenchmark.openTelemetryClassic thrpt 25 390.982 ± 16.058 ops/s
25-
* HistogramBenchmark.openTelemetryExponential thrpt 25 320.160 ± 18.056 ops/s
26-
* HistogramBenchmark.prometheusClassic thrpt 25 2385.862 ± 34.766 ops/s
27-
* HistogramBenchmark.prometheusNative thrpt 25 1947.371 ± 48.193 ops/s
28-
* HistogramBenchmark.simpleclient thrpt 25 4324.961 ± 50.938 ops/s
23+
* Benchmark Mode Cnt Score Error Units
24+
* HistogramBenchmark.openTelemetryClassic thrpt 6725.610 ops/s
25+
* HistogramBenchmark.openTelemetryExponential thrpt 5280.926 ops/s
26+
* HistogramBenchmark.prometheusClassic thrpt 14286.384 ops/s
27+
* HistogramBenchmark.prometheusNative thrpt 2385.134 ops/s
28+
* HistogramBenchmark.simpleclient thrpt 4062.732 ops/s
2929
* </pre>
3030
*
3131
* The simpleclient (i.e. client_java version 0.16.0 and older) histograms perform about the same as

0 commit comments

Comments
 (0)