mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-20 06:04:11 +00:00
* refactor(telemetry): replace PrintTraceSummary positional params with TraceSummary struct PrintTraceSummary had grown to nine positional parameters after the session ID landed in #870, making call sites hard to read and easy to get wrong. Introduce a TraceSummary struct and pass it as a single argument (Option A in the issue); printed output is unchanged. Also add stdout.Swap, which swaps the package writer under the existing mutex and returns a restore function, so tests can capture and assert output written through stdout.Writer(). The PrintTraceSummary tests now assert the exact summary, cache-token, and session lines instead of only verifying the call does not panic. Closes #906 * docs(stdout): clarify Swap concurrency doc comment The mutex in Swap and its restore closure already guarantees memory safety under concurrent access; the remaining hazard is semantic — concurrent swaps produce non-deterministic restore ordering. Rephrase the comment to state that distinction, as suggested in PR review. |
||
|---|---|---|
| .. | ||
| config.go | ||
| config_test.go | ||
| events.go | ||
| events_test.go | ||
| exporter.go | ||
| exporter_test.go | ||
| metrics.go | ||
| metrics_test.go | ||
| provider.go | ||
| provider_test.go | ||
| shutdown.go | ||
| shutdown_test.go | ||
| span.go | ||
| span_test.go | ||
| traceid_test.go | ||