Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The async-health observer contaminates memory/threading metrics, while incompatible summary inputs and unreachable current-only branches break reporting and per-unit orchestration.
4 open issues
What changed in this PR
Adds opt-in async-health diagnostics to SqlClient’s benchmark infrastructure, measuring ThreadPool responsiveness and process resources without changing shipped driver APIs.
Changes:
- Adds attribute-based diagnosis, bounded probe accounting, versioned artifacts, and SQL-free calibration workloads.
- Extends performance runners and pipelines with workload-config selection, sidecar collection, and current-only orchestration.
- Adds observer, reporting, and lifecycle tests, plus usage and measurement-limit documentation.
| File | Description |
|---|---|
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj |
Links observer sources into modern-framework unit tests. |
src/Microsoft.Data.SqlClient/tests/UnitTests/Measurements/ThreadPoolHealthObserverTests.cs |
Tests observation shutdown and grace-period behavior. |
src/Microsoft.Data.SqlClient/tests/UnitTests/AsyncHealthTests.cs |
Tests probe accounting, snapshots, failures, and options. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.default.jsonc |
Adds observer defaults and updates timeout documentation. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.connection-smoke.jsonc |
Adds bounded connection and contention workloads. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/README.md |
Introduces diagnoser selection and links detailed guidance. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Program.cs |
Registers calibration workloads and bounds benchmark execution. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Measurements/ThreadPoolProbeRecorder.cs |
Implements bounded probe accounting and snapshot copying. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Measurements/ThreadPoolHealthObserver.cs |
Samples ThreadPool responsiveness and process resources. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Measurements/AsyncHealthDiagnoser.cs |
Integrates attribute selection and diagnostic lifecycle hooks. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Measurements/AsyncHealthCase.cs |
Exports versioned case measurements and failure artifacts. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Config/Config.cs |
Adds observer and calibration configuration fields. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Config/BenchmarkConfig.cs |
Registers diagnosis and per-case timeout handling. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/Config/AsyncHealthOptions.cs |
Defines and validates observer settings. |
src/Microsoft.Data.SqlClient/tests/PerformanceTests/BenchmarkRunners/AsyncHealthCalibrationRunner.cs |
Adds SQL-free interference controls and lifecycle counters. |
src/Microsoft.Data.SqlClient/tests/Directory.Packages.props |
Updates BenchmarkDotNet packages for in-process hooks. |
eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml |
Adds workload selection and current-only baseline suppression. |
eng/pipelines/perf/sqlclient-perf-pipeline.yml |
Passes workload configuration to platform runners. |
eng/pipelines/perf/sqlclient-perf-experiment.yml |
Adds workload selection to switch experiments. |
eng/pipelines/perf/scripts/tests/test_runner_config.py |
Tests alternate workload configuration selection. |
eng/pipelines/perf/scripts/tests/test_async_health.py |
Tests reporting, collection, isolation, and process lifecycle behavior. |
eng/pipelines/perf/scripts/show_perf_results.sh |
Includes async-health Markdown in displayed reports. |
eng/pipelines/perf/scripts/run-perf-tests.sh |
Adds workload selection and no-baseline orchestration branches. |
eng/pipelines/perf/scripts/run-perf-tests.ps1 |
Adds equivalent PowerShell runner support. |
eng/pipelines/perf/scripts/interleave_perf.py |
Collects sidecars and adds current-only execution and optional watchdogs. |
eng/pipelines/perf/scripts/async_health_report.py |
Validates artifacts and computes health summaries and comparisons. |
eng/pipelines/perf/README.md |
Documents lifecycle boundaries, coverage rules, calibration, and usage. |
Review effort: Balanced
| if (signal == BenchmarkSignal.BeforeExtraIteration) | ||
| { | ||
| _owner.StartWindow(); |
| } else { | ||
| $baselineExeDir = "" | ||
| $currentExeDir = Build-Variant "current" $PerfProject @() |
| else | ||
| build_variant "current" "${PERF_PROJECT}" | ||
| baselineExeDir="" | ||
| currentExeDir="${REPO_ROOT}/perf-build-current" |
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Generate separate JSON, CSV, and Markdown diagnostic summaries before artifact collection. Include all probe clocks and sampled resource counters without altering normal timing reports. Co-authored-by: Copilot App <[email protected]>
Add the pipeline-injected connection property when absent, matching the Linux runner. Exercise the checked-in minimal calibration config in both shell harnesses. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #5014 +/- ##
==========================================
- Coverage 73.37% 67.12% -6.25%
==========================================
Files 311 307 -4
Lines 45304 68934 +23630
==========================================
+ Hits 33240 46271 +13031
- Misses 12064 22663 +10599
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Use 32 operations with a 1500 ms wait per operation for every calibration case. Preserve scheduling differences, report workload parameters and assert completed work at iteration boundaries. Co-authored-by: Copilot App <[email protected]>
Tag single, concurrent, and contended asynchronous connection workloads. Run three observations per async case while preserving short-window coverage and timing-only synchronous controls. Co-authored-by: Copilot App <[email protected]>
Add a live TUI for pooled and non-pooled OpenAsync workloads, shared netem controls, and runtime-selectable V2 LongRunning dispatch. Wire Linux latency injection and provenance into performance pipelines with regression coverage. Co-authored-by: Copilot App <[email protected]>
Archive the authenticated RTT study, compact results, and graphs alongside the playground. Add fresh-process path coverage, outcome accounting, comparison gates, and report tooling for later pipeline integration. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Both entry points have unreachable current-only orchestration branches, bypassing per-unit isolation and summaries, and benchmark failures can skip artifact collection and diagnostic reporting.
4 open issues
1 resolved since last review
Review effort: Balanced
| run_pass "current" "${PERF_PROJECT}" | ||
| fi | ||
|
|
||
| python3 "${SCRIPT_DIR}/async_health_report.py" --results-dir "${RESULTS_DIR}" |


Description
[AsyncHealthDiagnoser]selection on benchmark classes and methods. All 11 SQL-free calibration benchmarks are selected.Experiment preservation: 2026-11-13
This PR also preserves the subsequent experiments through
02d68bb1be990f50e82d2c20bee24c231fdcf831: theOpenAsyncLabTUI, SQL-only netem tooling, experimental live V2 LongRunning dispatch switch, fresh-process OpenAsync health harness, balanced V1/V2/non-pooled cold/warm coverage, comparison gates, and report generators. The switch is an opt-in experiment, not a production recommendation or a fully asynchronous connection-creation fix.Compact reports, SVG graphs and all summary rows are checked in under OpenAsyncLab/reports/2026-11-13. This includes the 240-run authenticated WSL RTT study, the earlier 63-run Windows/negative-control study, and 40 managed/native SNI success-path execution validations. Large raw probe/log archives remain in the originating session Library rather than large Git blobs.
A separate focused PR is being prepared from
mainfor automatic performance-pipeline execution. This PR remains the preservation branch for the broader experiments; it is not a claim that those experimental changes are ready to ship together.Issues
No linked issue.
Testing
Latest experiment validation
python -B -m unittest discover -s eng\pipelines\perf\scripts\tests -p 'test_openasync*.py' -q— passed: 22 tests.dotnet test src\Microsoft.Data.SqlClient\tests\UnitTests\Microsoft.Data.SqlClient.UnitTests.csproj -c Release -f net10.0 --filter 'FullyQualifiedName~OpenAsyncHealthSettingsTests|FullyQualifiedName~ThreadPoolHealthObserverTests|FullyQualifiedName~AsyncHealthTests' --nologo -v quiet— passed: 19 tests, no skips.git diff --cached --check— passed before the preservation commit.Earlier validation (historical)
Full Local Calibration: 2026-11-05
All 11 benchmarks completed in 185 seconds and produced 11 validated, completed diagnostic windows with Supported coverage. Zero dropped, rejected, skipped, producer-missed, or late/outstanding probes across the run.
Settings: one process, LaunchCount=1, IterationCount=2, InvocationCount=1, WarmupCount=1, Monitoring, default 25 ms probe cadence / capacity 64 / 500 ms completion grace. Windows 11 Hyper-V, .NET 10.0.14, SDK 10.0.403, 16 logical cores. No ThreadPool limit changes.
Timing means come from normal iterations; health metrics come from each case's separate diagnostic iteration. This is a short local calibration on a VM, not a statistically independent process comparison or proof of async correctness. Pool thread peaks include threads retained from earlier cases and exclude dedicated LongRunning threads. Raw reports and the full log were retained outside the checkout.
Guidelines
Please review the contribution guidelines before submitting a pull request:
Checklist