Repository navigation
ci: add .NET SDK performance reports - #358
dustinbyrne wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
PostHog Review · Standard · reviewed 166d3e7: 2 Should fix.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
| workloads = Fixtures.Workloads(args.Contains("--smoke")).Select(spec => new | ||
| { | ||
| spec, | ||
| fixture_digest = Fixtures.Digest(Fixtures.Definitions(spec.FlagCount) + JsonSerializer.Serialize(Fixtures.Options, Json) + JsonSerializer.Serialize(spec, Json)), |
There was a problem hiding this comment.
P2 · Hash explicit fixture inputs instead of the SDK options schema
When a PR adds a serializable property to FeatureFlagOptions or its base class, serializing Fixtures.Options includes that property only in the head build, even with its default value. The resulting fixture_digest mismatch makes the coordinator reject both inventories before running benchmarks. Hash a benchmark-owned representation of the explicit inputs instead.
| subprocess.check_output( | ||
| ["dotnet", str(worker), "describe", *(["--smoke"] if smoke else [])], | ||
| env=environment(), | ||
| text=True, | ||
| ) |
There was a problem hiding this comment.
P2 · Apply a deadline to the describe subprocess
When SDK construction or disposal hangs, describe() blocks indefinitely because this check_output has no timeout. The describe command constructs and disposes PostHogClient, so lifecycle regressions bypass the worker deadline and timeout budget, consuming the workflow's 30-minute limit before either results document exists. Bound this subprocess with TIMEOUT.
posthog-dotnet Compliance ReportDate: 2026-10-28T22:43:13.270566+00:00 ✅ All Tests Passed!47/47 tests passed Capture Tests✅ 30/30 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
| if (request.Method == HttpMethod.Get && request.RequestUri?.AbsolutePath.TrimEnd('/') == "/flags/definitions") | ||
| { | ||
| Interlocked.Increment(ref DefinitionRequests); | ||
| return Response(Fixtures.Definitions(spec.FlagCount, Generation)); |
There was a problem hiding this comment.
P2 · Prepare definition responses outside the measured reloads
During flags.refresh.1000, every measured reload calls Fixtures.Definitions here, constructing the 1,000-flag object graph and serializing JSON inside the worker. These mock-server allocations inflate measured RSS and GC pressure, obscuring changes in the SDK's reload memory usage. Precompute generation responses before measurement and serve those fixtures.
💡 Motivation and Context
Extend SDK PR performance reporting to .NET, alongside Node and Python, using the shared reporting action and trusted publisher from PostHog/.github#84.
workflow_runpublisher produces sticky comments once the caller workflow lands on the default branch.The C# workers use .NET 9.0.8 with workstation GC and non-tiered JIT; the Python coordinator uses only the standard library. SDK dependencies restore in locked mode. Offline HTTP injection retains the SDK's public lifecycle without requiring credentials. Documentation lives in the existing contributing guide.
No SDK runtime/public API changes or NuGet release are included; no changeset is needed.
💚 How did you test it?
dotnet restore --locked-mode,bin/fmt --check, and the existing net8.0 unit suite: 1,403 passed, 2 skipped.git diff --checkpassed. All action/workflow SHA references were verified through GitHub.📝 Checklist
🤖 Agent context
Autonomy: Human-driven (agent-assisted).
Implemented with Pi and checked by a fresh read-only reviewer. Validation used .NET, Python, Actionlint and the shared benchmark reporter. The design keeps instrumentation native to .NET and reporting shared across SDKs; this PR requires human review.