Files
cacti/tests/Unit/DataCollection/Poller
bd9998e723 fix: Improve Script Server performance by guarding debug log strings (#8586)
Building the per-request INC and RESPONSE debug log strings (basename(),
implode() and string concatenation) on every poll is wasteful when debug
logging is disabled, which is the normal production configuration.

Introduce testable helpers in lib/functions.php:
- cacti_effective_log_level() resolves the effective verbosity the same way
  cacti_log() does (selective per-file/per-plugin override, else log_verbosity).
- script_server_log_request() / script_server_log_response() only assemble and
  emit their debug strings when that level is POLLER_VERBOSITY_DEBUG.

script_server.php now calls these helpers instead of building the strings
inline, so the hot path stays cheap while selective script-server debugging
keeps working. Unit coverage is added for the new helpers.

This is the develop counterpart of the 1.2.x change in #8585.

Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-04 15:38:01 -05:00
..
2026-11-03 12:45:02 -05:00