Skip to content

Add lightweight page-load performance instrumentation#648

Draft
ledpup wants to merge 1 commit into
developmentfrom
codex/work-on-issue-#647
Draft

Add lightweight page-load performance instrumentation#648
ledpup wants to merge 1 commit into
developmentfrom
codex/work-on-issue-#647

Conversation

@ledpup

@ledpup ledpup commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide lightweight, low-cost diagnostics to measure page-load and chart-render performance without adding a full telemetry provider.
  • Make it easier to triage slow paths (reference data, dashboard anomaly/stripe work, and chart dataset preparation).
  • Capture API client timings (including cache state and record counts) to spot expensive or duplicated requests.

Description

  • Added a reusable C# timing scope PerformanceLogScope at ClimateExplorer.Web.Client/Infrastructure/PerformanceLogScope.cs that emits PerfStart/PerfEnd log lines with elapsed milliseconds and contextual fields.
  • Added a small browser helper window.climateExplorerPerformance in ClimateExplorer.Web/wwwroot/js/performance-instrumentation.js and load it from the app shell (ClimateExplorer.Web/App.razor) to emit ClimateExplorer: Performance marks/measures to DevTools and the Performance timeline.
  • Instrumented key client lifecycle and UI paths with both server logs and browser marks: Index page lifecycle and reference-data load (Index.razor.cs), LocationDashboard deferred data loading (LocationDashboard.razor.cs), and chart build/render flows in ChartView (ChartView.razor.cs).
  • Enhanced the API client (ClimateExplorer.WebApiClient/Services/DataService.cs) to log PostDataSet timings and to centralise GET timings via GetFromJsonWithTiming, including cache state and record counts; added docs/performance/page-load-instrumentation.md describing instrumentation and how to compare cold/warm loads.

Testing

  • Ran git diff --check to validate whitespace and basic diffs, which succeeded.
  • Attempted dotnet build ClimateExplorer.sln, but the build could not be executed in this environment because dotnet is not installed (automated build unavailable here).
  • No runtime/integration tests were run in this container due to missing .NET SDK; manual verification is documented in docs/performance/page-load-instrumentation.md for local testing with the full dev setup.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analyse page-load performance and add lightweight instrumentation

1 participant