Files
sencho/backend
Anso 9e20acd647 chore(dashboard): add developer-mode timing diagnostics on dashboard routes (#1219)
Both dashboard endpoints (/configuration and /stack-restarts) execute on
the hot path of every dashboard mount or refresh, and one of them
(/configuration via buildLocalConfigurationStatus) reads from a dozen
database tables. When an operator reports a slow dashboard on a large
deployment, there is currently no instrumentation to point at which
endpoint is the offender.

Gate two new debug lines behind isDebugEnabled (the existing developer-mode
flag, sourced from DatabaseService.global_settings.developer_mode). Each
line reports the elapsed milliseconds and a single contextual field
(nodeId, row count, days window). Both endpoints exit unchanged when
developer mode is off; the timing measurement and console call are skipped
entirely, not just suppressed.

Both error paths already log via console.error and stay that way; per
backend/src/utils/debug.ts comments, error paths are exempt from the
debug gate.
2026-05-25 12:10:40 -04:00
..