How dvorobiev/s3flood works
Purpose and entry points
s3flood is a Python console tool for generating file datasets, load-testing S3-compatible storage, browsing buckets, and emitting live/final performance results. Primary invocation routes are module startup and CLI dispatch in src/s3flood/__main__.py, src/s3flood/cli.py, with a packaging/standalone entry wrapper in s3flood_entry.py.
Command and interaction layer
The CLI exposes dataset creation, benchmark runs, bucket browsing, and an interactive menu. Interactive flows coordinate config selection/editing, validation, destructive bucket actions, and launch the same core run/browser capabilities rather than a separate backend.
Paths: src/s3flood/cli.py, src/s3flood/interactive.py, src/s3flood/config_editor.py.
Configuration and application-scoped state
Run settings are loaded from YAML then overridden by CLI inputs; defaults and validation define profiles, endpoints, retry/queue/pattern controls, reporting paths, and client settings. Dataset location is application-level state (.s3flood.yml) rather than a durable per-run config value, with a command-line override.
Paths: src/s3flood/config.py, src/s3flood/defaults.py, src/s3flood/app_settings.py.
Dataset generation and operation source
Dataset creation produces grouped small/medium/large files with configurable total size and fill mode. During a run, the dataset module enumerates and orders local files; these become write inputs, while read/mixed profiles target corresponding remote object names. This is the boundary between local filesystem content and load scheduling.
Paths: src/s3flood/dataset.py, src/s3flood/runner.py.
Load orchestration and execution
The runner builds the selected profile (write, read, mixed), chooses endpoints (including round-robin/random cluster routing), applies order, warmup, burst behavior, bounded queues, and infinite looping. The executor performs concurrent operations, retries failed work with exponential backoff, and tracks per-operation endpoint/thread/attempt details. Endpoint affinity preserves the write endpoint for later reads.
Paths: src/s3flood/runner.py, src/s3flood/executor.py, src/s3flood/config.py.
S3 client and external-service boundary
S3 I/O is delegated through supported command-line clients—default AWS CLI, plus rclone or s3cmd—rather than an in-process SDK. The tool targets any S3-compatible endpoint, such as MinIO or AWS S3; AWS CLI configuration/environment overrides support credentials, profiles, multipart behavior, and separate process startup overhead measurement.
Paths: src/s3flood/executor.py, src/s3flood/config.py, src/s3flood/s3browser_io.py.
Observability and output pipeline
Each operation yields raw metric records for CSV and feeds aggregate latency, throughput, error, and timeline calculations. The dashboard renders live terminal progress/sparklines when interactive; non-TTY operation prints periodic summaries. Completion generates structured JSON reporting plus console summaries, excluding warmup from aggregate results while retaining raw data.
Paths: src/s3flood/metrics.py, src/s3flood/dashboard.py, src/s3flood/runner.py.
Two-panel bucket browser
A terminal Norton-Commander-style browser presents local filesystem and S3 bucket panels, including bucket/prefix traversal, object version inspection, cross-panel copy/move/delete, selection, cancellation, and progress dialogs. Browser-specific S3 calls are separated from terminal rendering/control, forming a distinct interactive management path from the load executor.
Paths: src/s3flood/browser.py, src/s3flood/s3browser_io.py, src/s3flood/dashboard.py.
Main entry points: cli.py CLI dispatch · runner.py Run orchestrator · interactive.py Interactive menu · config.py Run configuration
Components 18
Entry & interaction
- Module startup
src/s3flood/__main__.py - Standalone wrapper
s3flood_entry.py - CLI dispatch · Starts dataset, benchmark, browser, and interactive commands.
src/s3flood/cli.py - Interactive menu · Reuses run and browser capabilities.
src/s3flood/interactive.py - Config editor
src/s3flood/config_editor.py
Configuration & data
- Run configuration · Loads YAML, CLI overrides, profiles, and validation.
src/s3flood/config.py - Defaults
src/s3flood/defaults.py - Dataset location state · Stores dataset location in .s3flood.yml.
src/s3flood/app_settings.py - Dataset generator · Creates grouped files and enumerates ordered write inputs.
src/s3flood/dataset.py
Load execution
- Run orchestrator · Builds profiles and applies routing, ordering, warmup, bursts, queues, and looping.
src/s3flood/runner.py - Concurrent executor · Runs operations, retries failures, and retains endpoint affinity.
src/s3flood/executor.py - S3 command clients · AWS CLI, rclone, or s3cmd perform S3 I/O.
src/s3flood/executor.py - S3-compatible storage · Target may be MinIO, AWS S3, or another compatible endpoint.
Metrics & output
- Metric aggregation · Calculates latency, throughput, errors, and timeline aggregates.
src/s3flood/metrics.py - Live dashboard · Renders interactive progress or periodic non-TTY summaries.
src/s3flood/dashboard.py - Final reports · Keeps raw operation data and emits final summaries.
src/s3flood/runner.py
Bucket browser
- Two-panel browser · Manages local files, buckets, prefixes, objects, and cross-panel actions.
src/s3flood/browser.py - Browser S3 I/O · Separates browser storage calls from terminal control.
src/s3flood/s3browser_io.py
Connections 26
- Module startup → CLI dispatch: starts
- Standalone wrapper → CLI dispatch: starts
- CLI dispatch → Interactive menu: opens
- Interactive menu → Config editor: edits settings
- CLI dispatch → Run configuration: loads and overrides
- Interactive menu → Run configuration: selects and validates
- Run configuration → Defaults: uses
- CLI dispatch → Dataset location state: resolves dataset location
- Dataset location state → Dataset generator: locates
- CLI dispatch → Dataset generator: creates
- CLI dispatch → Run orchestrator: launches
- Interactive menu → Run orchestrator: launches
- Run configuration → Run orchestrator: profiles and controls
- Dataset generator → Run orchestrator: local file operations
- Run orchestrator → Concurrent executor: schedules operations
- Concurrent executor → S3 command clients: invokes
- S3 command clients → S3-compatible storage: S3 requests
- Concurrent executor → Metric aggregation: raw operation records
- Metric aggregation → Live dashboard: live aggregates
- Metric aggregation → Final reports: final aggregates
- Run orchestrator → Final reports: writes raw CSV and JSON
- CLI dispatch → Two-panel browser: opens
- Interactive menu → Two-panel browser: opens
- Two-panel browser → Browser S3 I/O: storage actions
- Browser S3 I/O → S3-compatible storage: browser S3 calls
- Two-panel browser → Live dashboard: progress dialogs