You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add structured result export for sqlstresscmd - #225
The CLI result export path was only partially implemented: -r/--results existed but was effectively CSV-only, still carried stale TODO metadata, and emitted culture-sensitive values that were awkward for downstream tooling. This change formalizes the export contract so result files can be archived, consumed by automation, and parsed reliably.
Result export model
Added a shared RunResult record for structured run summaries with ISO-8601 timestamps and invariant numeric formatting.
JSON output is now produced via the existing serializer, while CSV keeps its append-friendly behavior.
CLI behavior
-r/--results accepts CSV or JSON destinations.
-f/--format can override format detection when the file extension is ambiguous.
Default behavior remains extension-based, so normal CSV workflows continue to work.
Documentation and usability
Removed the stale TODO from the CLI option definition.
Updated the CLI README and help text to document the supported export flows.
Reject unsupported extensions instead of defaulting to CSV
src/SqlQueryStressCLI/LoadRunner.cs:315
Unknown or missing extensions currently fall through to CSV, so paths such as results.jsn or results.xml succeed while containing CSV despite format detection being extension-based. Normalize and return the actual extension here so the existing default branch rejects unsupported/ambiguous names; callers can use -f when the filename has no recognized extension.
@copilot Unknown or missing extensions currently fall through to CSV, so paths such as results.jsn or results.xml succeed while containing CSV despite format detection being extension-based. Normalize and return the actual extension here so the existing default branch rejects unsupported/ambiguous names; callers can use -f when the filename has no recognized extension.
@copilot Unknown or missing extensions currently fall through to CSV, so paths such as results.jsn or results.xml succeed while containing CSV despite format detection being extension-based. Normalize...
Changed extension-based detection to return the normalized extension, so unsupported and missing extensions are rejected unless -f overrides the format. Committed as 8783e18.
Avoid disposing ManualResetEventSlim while Set may still be running
src/SqlQueryStressCLI/LoadRunner.cs:142
Wait() may return as soon as Set() marks the event signaled, before the completion thread has returned from Set(). Disposing ManualResetEventSlim concurrently with Set() is unsupported and can race the completion callback. Keep this one-shot event alive for the runner's lifetime (or replace it with a task-based completion primitive) instead of disposing it here.
@copilot Wait() may return as soon as Set() marks the event signaled, before the completion thread has returned from Set(). Disposing ManualResetEventSlim concurrently with Set() is unsupported and can race the completion callback. Keep this one-shot event alive for the runner's lifetime (or replace it with a task-based completion primitive) instead of disposing it here.
@copilot Wait() may return as soon as Set() marks the event signaled, before the completion thread has returned from Set(). Disposing ManualResetEventSlim concurrently with Set() is unsupported and ca...
Removed the post-Wait() disposal so the one-shot event remains alive for the runner’s lifetime and cannot race Set(). Addressed in 3a7aca9. CLI Release build passed; review and CodeQL found no issues.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Unsupported formats are rejected only after the SQL workload has already executed.
0 open findings
Previously missed (1)
In code that hasn't changed since last review
Validate output format before executing SQL workload
src/SqlQueryStressCLI/LoadRunner.cs:88
Unsupported output formats are validated only after the SQL workload completes. A typo such as -f jsno can therefore execute a long-running or mutating query before the CLI reports that the command is invalid. Resolve and reject the format at the start of Run, before testing the connection or starting the worker.
@copilot
Unsupported output formats are validated only after the SQL workload completes. A typo such as -f jsno can therefore execute a long-running or mutating query before the CLI reports that the command is invalid. Resolve and reject the format at the start of Run, before testing the connection or starting the worker.
@copilot
Unsupported output formats are validated only after the SQL workload completes. A typo such as -f jsno can therefore execute a long-running or mutating query before the CLI reports that t...
Unsupported result formats are now rejected at the start of Run(), before connection testing or workload execution. Committed as HEAD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI result export path was only partially implemented:
-r/--resultsexisted but was effectively CSV-only, still carried stale TODO metadata, and emitted culture-sensitive values that were awkward for downstream tooling. This change formalizes the export contract so result files can be archived, consumed by automation, and parsed reliably.Result export model
RunResultrecord for structured run summaries with ISO-8601 timestamps and invariant numeric formatting.CLI behavior
-r/--resultsaccepts CSV or JSON destinations.-f/--formatcan override format detection when the file extension is ambiguous.Documentation and usability
Example:
This keeps the existing behavior for trend CSV files while enabling a stable, machine-readable JSON export for baselining and CI workflows.