Skip to content

Run mongodb-benchmarking#1255

Open
chilagrow wants to merge 44 commits intoFerretDB:mainfrom
chilagrow:mongodb-benchmarking
Open

Run mongodb-benchmarking#1255
chilagrow wants to merge 44 commits intoFerretDB:mainfrom
chilagrow:mongodb-benchmarking

Conversation

@chilagrow
Copy link
Contributor

@chilagrow chilagrow commented May 23, 2025

Closes #1201.

@chilagrow chilagrow added the code/feature Some dance tool feature is not implemented yet label May 27, 2025
- 100000
- -uri
- {{.MONGODB_URI}}
- --runAll
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple example from readme https://github.com/idealo/mongodb-benchmarking?tab=readme-ov-file#run-all-tests.
It takes about 1 min to run, do we want to tweak the parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively we can run insert, update, delete ops in separate config, that would allow ferretdb-postgresql to benchmark operations that do not return the error aggregate stage "$sample" is not implemented yet

@chilagrow chilagrow enabled auto-merge (squash) May 27, 2025 07:46
@chilagrow chilagrow requested review from a team, Copilot and noisersup May 27, 2025 07:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for running and parsing results from the mongodb-benchmarking tool via a new mongobench runner, updates dependency versions (including the new submodule), and adjusts CI workflows to fetch submodules.

  • Introduces a mongoBench runner under internal/runner/mongobench with parsing and tests.
  • Defines a generic Measurements interface and updates config types to support multiple runner outputs.
  • Adds mongodb-benchmarking as a Git submodule, updates tools/go.mod, and enables submodule checkout in CI.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/go.mod Added benchmarking tool, version bumps, local replace
.gitmodules Updated submodule URL for mongodb-benchmarking
.github/workflows/go.yml & dance.yml Enabled submodules: true for CI
internal/runner/mongobench/*.go/.yml/.test.go New mongobench runner implementation & tests
internal/config/runner.go, configload, results.go Added RunnerTypeMongoBench, Measurements interface
internal/runner/ycsb/ycsb.go Refactored YCSB parser to use measurement type

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
noisersup
noisersup previously approved these changes May 28, 2025
@chilagrow chilagrow requested review from Copilot and noisersup May 30, 2025 01:30

This comment was marked as outdated.

auto-merge was automatically disabled June 17, 2025 07:05

Pull Request is not mergeable

@chilagrow chilagrow requested a review from Copilot July 3, 2025 02:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new mongobench runner to execute MongoDB benchmarking via the mongodb-benchmarking binary and integrate its results into the existing CI pipeline.

  • Introduce a mongobench runner implementation (parseFileNames, readResult, run, Run)
  • Extend configuration loading and CLI to support RunnerTypeMongoBench
  • Add CI job mongobench-runall under .github/workflows/dance.yml

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/mongobench-runall.yml Defines a new benchmark suite with threads, docs, URI, and results mapping
internal/runner/mongobench/mongobench.go Implements the runner logic, including parsing and reading results
internal/runner/mongobench/mongobench_test.go Unit tests for parsing filenames and reading CSV results
internal/configload/runner.go Adds YAML-to-config conversion for mongobench parameters
internal/configload/configload.go Registers RunnerTypeMongoBench in the configuration loader
internal/config/runner.go Defines RunnerTypeMongoBench constant and params struct
cmd/dance/main.go Wires up mongobench.New in the CLI command switch
.github/workflows/dance.yml Registers the new mongobench-runall job in CI
Comments suppressed due to low confidence (1)

internal/runner/mongobench/mongobench.go:152

  • The 'run' function orchestrating process execution, parsing filenames, and reading results currently lacks direct unit or integration tests. Consider adding tests that mock or stub exec.Command to verify end-to-end behavior and error paths.
func run(ctx context.Context, args []string, dir string) (map[string]config.TestResult, error) {

for _, fileName := range fileNames {
var m map[string]float64

if m, err = readResult(filepath.Join("..", "projects", fileName)); err != nil {
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

Using a hardcoded path '../projects' to locate result files may not align with the runner's working directory. Consider constructing the file path based on the configured 'dir' parameter or the actual command working directory.

Suggested change
if m, err = readResult(filepath.Join("..", "projects", fileName)); err != nil {
if m, err = readResult(filepath.Join(dir, "projects", fileName)); err != nil {

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code/feature Some dance tool feature is not implemented yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Run idealo's mongodb-benchmarking

3 participants