Skip to content

Support export feature#140

Merged
nakabonne merged 14 commits intomasterfrom
feat/export
Jan 19, 2026
Merged

Support export feature#140
nakabonne merged 14 commits intomasterfrom
feat/export

Conversation

@nakabonne
Copy link
Copy Markdown
Owner

Close #96

What changed

Add an export feature that persists load test results for downstream processing:

  • Export all data points to results.csv in a stable schema.
  • Export a summary to summary-<id>.json.

How to test

go build
./ali -r 1 -d 3s --export-to ./results https://nakabonne.dev/

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 19, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 32.28571% with 237 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.51%. Comparing base (15f0b82) to head (be4738d).

Files with missing lines Patch % Lines
export/export.go 42.64% 88 Missing and 25 partials ⚠️
attacker/attacker.go 19.30% 43 Missing and 3 partials ⚠️
attacker/summary.go 0.00% 43 Missing ⚠️
main.go 47.83% 9 Missing and 3 partials ⚠️
gui/drawer.go 30.77% 9 Missing ⚠️
gui/keybinds.go 10.00% 9 Missing ⚠️
gui/gui.go 40.00% 2 Missing and 1 partial ⚠️
attacker/fake_attacker.go 0.00% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #140      +/-   ##
==========================================
- Coverage   60.82%   54.51%   -6.31%     
==========================================
  Files          11       13       +2     
  Lines         929     1266     +337     
==========================================
+ Hits          565      690     +125     
- Misses        329      504     +175     
- Partials       35       72      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

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

This pull request adds an export feature to persist load test results for downstream processing. The feature allows users to export attack results to CSV and JSON formats using the new --export-to flag.

Changes:

  • Added --export-to CLI flag to export results to a specified directory
  • Implemented CSV export for individual request data points (results.csv)
  • Implemented JSON export for aggregated summary statistics (summary-<id>.json)

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
export/export.go Core export logic with atomic file writes, CSV/JSON serialization, and proper error handling
export/export_test.go Comprehensive unit tests covering basic functionality, edge cases, and atomic writes
export_golden_test.go Golden file tests validating CSV and JSON schema correctness
export_pending_test.go Integration tests for CLI export functionality
attacker/attacker.go Integration of export functionality into the attack loop with UUID generation
attacker/summary.go Conversion of metrics to export summary format
attacker/fake_attacker.go Updated FakeAttacker to return error from Attack method
attacker/attacker_test.go Updated tests for new Attack signature
gui/keybinds.go Modified attack function to handle and propagate export errors
gui/gui.go Export error handling in GUI lifecycle
gui/drawer.go Thread-safe export error tracking
main.go CLI integration with directory validation and exporter initialization
main_test.go Updated CLI tests to include exportTo field
docs/export.md User-facing documentation explaining export feature usage
docs/rfc/001-export.md Design document with requirements and specifications
README.md Updated with export feature description
testdata/export/* Golden test data files for various scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/rfc/001-export.md Outdated
Comment thread docs/rfc/001-export.md Outdated
Comment thread main.go
@nakabonne nakabonne changed the title Feat/export Support export feature Jan 19, 2026
@nakabonne nakabonne merged commit 234bdf3 into master Jan 19, 2026
5 checks passed
@nakabonne nakabonne deleted the feat/export branch January 19, 2026 05:49
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.

Export Functionality

3 participants