Skip to content

Add JuiceFS diagnostics to small-file benchmark - #27

Merged
aniketmaurya merged 2 commits into
mainfrom
benchmark-juicefs-diagnostics
Jul 3, 2026
Merged

Add JuiceFS diagnostics to small-file benchmark#27
aniketmaurya merged 2 commits into
mainfrom
benchmark-juicefs-diagnostics

Conversation

@aniketmaurya

@aniketmaurya aniketmaurya commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • capture JuiceFS version/processes and optional stats/profile output in the small-file storage benchmark
  • add --delete-mode juicefs-rmr to compare normal recursive cleanup with JuiceFS' optimized recursive delete path
  • keep JuiceFS stats capture enabled by default, with --no-juicefs-stats to disable it
  • ignore local .firecrawl/ research artifacts

Validation

  • uv run ruff check benchmarks/small_files_storage.py
  • uv run python -m py_compile benchmarks/small_files_storage.py
  • remote benchmark script compile smoke test
  • uv run python benchmarks/small_files_storage.py --help

Summary by CodeRabbit

  • New Features

    • Benchmarking now supports JuiceFS-aware runs, with options to capture storage stats, profile output, and choose how test data is removed.
    • Results now include additional runtime details such as stats snapshots and deletion method information.
  • Chores

    • Updated ignore rules to exclude local web research artifacts.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@aniketmaurya, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f47c9d1d-1752-435c-aa36-3c622066119c

📥 Commits

Reviewing files that changed from the base of the PR and between 46e8bfb and 7cd0fc7.

📒 Files selected for processing (1)
  • benchmarks/small_files_storage.py
📝 Walkthrough

Walkthrough

Right, listen up. This here PR teaches the small files storage benchmark to recognise a JuiceFS mount, take its stats before and after the graft, run a profiler if asked, and pick its poison for deletion — Python's own hand or juicefs rmr. New CLI switches, new printouts, and a quiet line added to .gitignore for good measure.

Changes

JuiceFS Benchmark Instrumentation

Layer / File(s) Summary
Remote JuiceFS helper utilities
benchmarks/small_files_storage.py
New embedded functions for subprocess capture, JuiceFS mount detection, juicefs stats collection, profile start/stop, and JuiceFS-aware deletion (rmr or shutil.rmtree).
benchmark_target execution flow and payload
benchmarks/small_files_storage.py
benchmark_target gains delete_mode, collect_juicefs_stats, juicefs_profile params; captures stats before/after write and delete, runs optional profiling, and returns an enriched result payload.
Local CLI wiring, validation, and output
benchmarks/small_files_storage.py
Adds --delete-mode, --no-juicefs-stats, --juicefs-profile flags, validates delete_mode, threads the options through remote_args, and prints juicefs_version, delete method, and stats/profile status locally.
Ignore local research artifacts
.gitignore
Adds a section ignoring the .firecrawl/ directory.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LocalCLI
  participant RemoteScript
  participant benchmark_target
  participant JuiceFS

  LocalCLI->>RemoteScript: invoke with delete_mode, collect_juicefs_stats, juicefs_profile
  RemoteScript->>benchmark_target: call with new parameters
  benchmark_target->>JuiceFS: capture stats before write
  benchmark_target->>benchmark_target: run concurrent downloads
  benchmark_target->>JuiceFS: capture stats after write
  benchmark_target->>JuiceFS: start profile process (optional)
  benchmark_target->>JuiceFS: delete target (python or juicefs rmr)
  benchmark_target->>JuiceFS: capture stats after delete
  benchmark_target->>JuiceFS: stop profile process (finally)
  benchmark_target-->>RemoteScript: return result payload with delete/stats/profile fields
Loading

Poem

By order of the benchmark family, we run our racket clean,
Stats before, stats after — nothing left unseen.
rmr or Python's hand, either way it's gone,
Profile ticking quiet while the download rolls on.
Not by luck, but by design — this is Small Heath, we plan it right. 🐎🔥

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding JuiceFS diagnostics to the small-file benchmark.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch benchmark-juicefs-diagnostics

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@benchmarks/small_files_storage.py`:
- Around line 247-252: The `subprocess.run` call in the `juicefs rmr` cleanup
path has no timeout, unlike the other benchmark commands, so a hung recursive
delete can block the run indefinitely. Update the `completed =
subprocess.run(...)` invocation in `small_files_storage.py` to pass the same
timeout pattern used elsewhere in the benchmark helpers, and keep the existing
`check=False`, `capture_output=True`, and `text=True` behavior intact.
- Around line 261-267: Treat failed or incomplete deletes as failed deletes in
the delete path handled by the benchmark helper around the juicefs rmr and
shutil.rmtree calls. Update the delete logic so a nonzero return from juicefs
rmr always raises an error, even if target_dir no longer exists, and do not
silently ignore cleanup failures from shutil.rmtree. Use the existing delete
flow in the function that returns result to surface any delete failure
consistently.
- Around line 216-225: The profiling startup path in the `juicefs profile`
launcher currently swallows `Popen` failures by returning `None`, which makes a
requested profile look like it never ran. Update the helper around
`subprocess.Popen` to surface the failure as an explicit error payload instead
of `None`, and make the caller for `--juicefs-profile` propagate that payload so
operators can tell `juicefs` diagnostic startup failed. Use the existing
profile-launch code path and symbols like `subprocess.Popen` and the
`--juicefs-profile` handling to locate and adjust the flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3ee859fd-6a8d-4586-827b-07e0b8fea7cd

📥 Commits

Reviewing files that changed from the base of the PR and between 2deba10 and 46e8bfb.

📒 Files selected for processing (2)
  • .gitignore
  • benchmarks/small_files_storage.py

Comment thread benchmarks/small_files_storage.py Outdated
Comment thread benchmarks/small_files_storage.py
Comment thread benchmarks/small_files_storage.py Outdated
@aniketmaurya
aniketmaurya merged commit 6f4e150 into main Jul 3, 2026
7 checks passed
@aniketmaurya
aniketmaurya deleted the benchmark-juicefs-diagnostics branch July 3, 2026 16:27
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.

1 participant