@wpmoo/toolkit 0.9.13 → 0.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/doctor.js +11 -0
  2. package/package.json +1 -1
package/dist/doctor.js CHANGED
@@ -195,6 +195,13 @@ function postgresConnectionUtilizationWarning(diagnostics) {
195
195
  }
196
196
  return `PostgreSQL connection utilization is high: ${utilizationPct}% of max_connections used (${connectionCount}/${maxConnections}).`;
197
197
  }
198
+ function postgresSlowQueryLoggingWarning(diagnostics) {
199
+ const slowQueryLogging = diagnostics.slow_query_logging?.trim();
200
+ if (!slowQueryLogging || !/^-1\s*(?:ms)?$/iu.test(slowQueryLogging)) {
201
+ return undefined;
202
+ }
203
+ return `PostgreSQL slow-query logging is disabled (log_min_duration_statement=${slowQueryLogging}). Enable it before performance triage.`;
204
+ }
198
205
  function structuredPostgresDiagnostics(diagnostics) {
199
206
  const structured = {};
200
207
  const databaseCount = integerDiagnostic(diagnostics.database_count);
@@ -637,6 +644,10 @@ export async function getDoctorReport(target = process.cwd(), runnerOrOptions =
637
644
  if (connectionUtilizationWarning) {
638
645
  warnings.push(connectionUtilizationWarning);
639
646
  }
647
+ const slowQueryLoggingWarning = postgresSlowQueryLoggingWarning(postgresDiagnostics);
648
+ if (slowQueryLoggingWarning) {
649
+ warnings.push(slowQueryLoggingWarning);
650
+ }
640
651
  }
641
652
  else {
642
653
  const warning = malformedKeys.length > 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpmoo/toolkit",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "WPMoo Toolkit for development, staging, and production lifecycle workflows.",
5
5
  "type": "module",
6
6
  "repository": {