Skip to content

Add CockroachDB TPC-C benchmark support#15

Open
MaximilianJahns wants to merge 3 commits into
green-coding-solutions:mainfrom
MaximilianJahns:feature/cockroachdb-benchmark
Open

Add CockroachDB TPC-C benchmark support#15
MaximilianJahns wants to merge 3 commits into
green-coding-solutions:mainfrom
MaximilianJahns:feature/cockroachdb-benchmark

Conversation

@MaximilianJahns
Copy link
Copy Markdown

Adds CockroachDB support for TPC-C benchmarking via HammerDB.
CockroachDB is PostgreSQL-compatible so it uses the pg driver. Includes build, run and delete schema scripts and a GMT usage scenario.

A 20 second startup wait is included in the usage scenario.

@ArneTR
Copy link
Copy Markdown
Member

ArneTR commented May 12, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

@ArneTR has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 39 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d69afd1-646c-420a-8ca9-94e477946e1b

📥 Commits

Reviewing files that changed from the base of the PR and between 8c9c0a5 and 05d6529.

📒 Files selected for processing (5)
  • cockroach/cockroach_tprocc_buildschema.tcl
  • cockroach/cockroach_tprocc_deleteschema.tcl
  • cockroach/cockroach_tprocc_run.tcl
  • compose.yml
  • usage_scenario_cockroach.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ribalba
Copy link
Copy Markdown
Member

ribalba commented May 12, 2026

This fails for me

Traceback (most recent call last):
  File "/Users/didi/code/green-metrics-tool/lib/schema_checker.py", line 241, in check_usage_scenario
    usage_scenario_schema.validate(usage_scenario)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/Users/didi/code/green-metrics-tool/venv/lib/python3.13/site-packages/schema/__init__.py", line 519, in validate
    raise SchemaWrongKeyError(message, e.format(data) if e else None)
schema.SchemaWrongKeyError: Wrong key 'sci' in {'name': 'HammerDB CockroachDB benchmark', 'author': 'Max Jahns', 'description': 'Benchmarks CockroachDB with HammerDB using TPC-C', 'sci': {'R_d': 'TPC-C SQL-op'}, 'services': {'hammerdb': {'image': 'tpcorg/hammerdb:latest', 'container_name': 'hammerdb_container'}, 'cockroachdb': {'image': 'cockroachdb/cockroach:latest', 'container_name': 'cockroachdb_container', 'command': 'start-single-node --insecure', 'ports': ['26257:26257']}}, 'flow': [{'name': 'Build Warehouses', 'container': 'hammerdb_container', 'commands': [{'type': 'console', 'note': 'RUN HAMMERDB BUILD', 'command': './hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_buildschema.tcl | tee /dev/stderr | awk \'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\n", substr($0, RSTART+16, RLENGTH-21)) }\'', 'shell': 'sh', 'log-stdout': True, 'read-sci-stdout': True}]}, {'name': 'Query Warehouses', 'container': 'hammerdb_container', 'commands': [{'type': 'console', 'note': 'RUN HAMMERDB RUN', 'command': './hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_run.tcl | tee /dev/stderr | awk \'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\n", substr($0, RSTART+16, RLENGTH-21)) }\'', 'shell': 'sh', 'log-stdout': True, 'read-sci-stdout': True}]}, {'name': 'Drop Warehouses', 'container': 'hammerdb_container', 'commands': [{'type': 'console', 'note': 'RUN HAMMERDB DROP', 'command': './hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_deleteschema.tcl | tee /dev/stderr | awk \'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\n", substr($0, RSTART+16, RLENGTH-21)) }\'', 'shell': 'sh', 'log-stdout': True, 'read-sci-stdout': True}]}]}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/didi/code/green-metrics-tool/./runner.py", line 241, in <module>
    run_id = runner.run()  # Start main code
  File "/Users/didi/code/green-metrics-tool/lib/scenario_runner.py", line 2941, in run
    raise exc
  File "/Users/didi/code/green-metrics-tool/lib/scenario_runner.py", line 2837, in run
    self._initial_parse()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Users/didi/code/green-metrics-tool/lib/scenario_runner.py", line 708, in _initial_parse
    schema_checker.check_usage_scenario(self._usage_scenario_original)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/didi/code/green-metrics-tool/lib/schema_checker.py", line 250, in check_usage_scenario
    raise SchemaError(f"Your compose file does contain a key that GMT does not support - Please check if the container will still run as intended. If you want to ignore this error you can add the attribute `ignore-unsupported-compose: true` to your usage_scenario.yml\nError: {error_message}") from e
schema.SchemaError: Your compose file does contain a key that GMT does not support - Please check if the container will still run as intended. If you want to ignore this error you can add the attribute `ignore-unsupported-compose: true` to your usage_scenario.yml
Error: ['Wrong key \'sci\' in {\'name\': \'HammerDB CockroachDB benchmark\', \'author\': \'Max Jahns\', \'description\': \'Benchmarks CockroachDB with HammerDB using TPC-C\', \'sci\': {\'R_d\': \'TPC-C SQL-op\'}, \'services\': {\'hammerdb\': {\'image\': \'tpcorg/hammerdb:latest\', \'container_name\': \'hammerdb_container\'}, \'cockroachdb\': {\'image\': \'cockroachdb/cockroach:latest\', \'container_name\': \'cockroachdb_container\', \'command\': \'start-single-node --insecure\', \'ports\': [\'26257:26257\']}}, \'flow\': [{\'name\': \'Build Warehouses\', \'container\': \'hammerdb_container\', \'commands\': [{\'type\': \'console\', \'note\': \'RUN HAMMERDB BUILD\', \'command\': \'./hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_buildschema.tcl | tee /dev/stderr | awk \\\'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\\\n", substr($0, RSTART+16, RLENGTH-21)) }\\\'\', \'shell\': \'sh\', \'log-stdout\': True, \'read-sci-stdout\': True}]}, {\'name\': \'Query Warehouses\', \'container\': \'hammerdb_container\', \'commands\': [{\'type\': \'console\', \'note\': \'RUN HAMMERDB RUN\', \'command\': \'./hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_run.tcl | tee /dev/stderr | awk \\\'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\\\n", substr($0, RSTART+16, RLENGTH-21)) }\\\'\', \'shell\': \'sh\', \'log-stdout\': True, \'read-sci-stdout\': True}]}, {\'name\': \'Drop Warehouses\', \'container\': \'hammerdb_container\', \'commands\': [{\'type\': \'console\', \'note\': \'RUN HAMMERDB DROP\', \'command\': \'./hammerdbcli auto /tmp/repo/cockroach/cockroach_tprocc_deleteschema.tcl | tee /dev/stderr | awk \\\'/System achieved [0-9]+ NOPM/ { match($0, /System achieved [0-9]+ NOPM/); printf("GMT_SCI_R=%s\\\\n", substr($0, RSTART+16, RLENGTH-21)) }\\\'\', \'shell\': \'sh\', \'log-stdout\': True, \'read-sci-stdout\': True}]}]}']

@MaximilianJahns
Copy link
Copy Markdown
Author

i will look at it, you are rigth i was using not the newest version of gmt... sry for that. swaped to the native windows version and got some problems with redis postgres becuase wsl and windows seems to share the db now even if i change ports in compose and config file... anyway now i am able to look at least at the dbs from wsl2 ubuntun and let them run again. one think i tackled into is the missing cpu util for the xboost. i could try to get one going to be able to compare the database within the frontend.

@ribalba
Copy link
Copy Markdown
Member

ribalba commented May 13, 2026

You don't need to have providers enabled. The important thing is that the runs run. We will then do the measurments on the cluster. When you are developing locally you can just disable the providers and all the other stuff./runner.py --dev-no-metrics --dev-no-sleep --dev-no-system-checks --dev-no-phase-stats --dev-cache-build --dev-no-container-dependency-collection I often also use --dev-no-save as I am just checking that everything is running.

@ribalba
Copy link
Copy Markdown
Member

ribalba commented May 13, 2026

You then only need to check that the SCI stuff works, but that is one run at the end (or on the cluster https://metrics.green-coding.io/request.html)

author: Max Jahns
description: Benchmarks CockroachDB with HammerDB using TPC-C
compose-file: !include compose.yml
services:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File should have an SCI. Please use https://docs.green-coding.io/docs/measuring/carbon/sci/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants