Project

General

Profile

Actions

Task #6122

closed

Task #6116: EPIC: Speed up the stats updater daemon (scripts/workflow/update_stats.sh)

Stop printing full IIKO response payloads to stdout

Added by Redmine Admin about 9 hours ago. Updated about 9 hours ago.

Status:
Resolved
Priority:
High
Assignee:
-
Start date:
08/26/2026
Due date:
% Done:

100%

Estimated time:

Description

Problem

The fetchers println entire response bodies:

  • IikoOlapV2RequestsFetchingService.fetchOlapData:55println(responseBody), the whole OLAP report
  • IikoServerEmployeesFetchingService.fetchEmployeesprintln(responseBody), the whole employee XML
  • IikoAuthTokensFetchingService.fetchToken — prints the token itself (a credential in the log)
  • IikoOlapV2RequestsFetchingService.fetchOlapData:37 — prints the url, which carries ?key=<token>
  • IikoStatsGatheringService.getMetricValuesFromIikoDateDesc — several printlns per day iteration (lines 123, 130, 179)

The daemon runs these under nohup, so every byte is a synchronous write to nohup.out, and the loop truncates that file between steps (echo "" > nohup.out). At hundreds of thousands of requests per round this is a meaningful share of wall clock, and it leaks the IIKO session token into a file on disk.

Proposed change

  • Replace payload printlns with SLF4J logger calls at DEBUG.
  • Never log the token or a url containing key= — redact.
  • Keep a small amount of INFO-level progress output (per company / per metric), not per day and not per payload.

Acceptance

  • A normal run produces bounded, human-readable progress output.
  • No token or key=-bearing url appears in the log at any level.
Actions #1

Updated by Redmine Admin about 9 hours ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Реализовано в ветке speedup/stats-daemon, коммит 50a6ebef.

println заменены на slf4j в IikoOlapV2RequestsFetchingService, IikoServerEmployeesFetchingService, IikoAuthTokensFetchingService, IikoStatsGatheringService и всех трёх командах сбора метрик. Тела ответов и тела запросов ушли на DEBUG, прогресс по компании/метрике остался на INFO, посуточные строки убраны из INFO совсем.

Токен больше не печатается: fetchToken логирует только логин, url с key= не логируется вообще, а в базу он попадает уже отредактированным (IikoRequestLogService.redact).

Корневой уровень в logback.xmlinfo, так что по умолчанию payload'ы в nohup.out не идут.

Actions

Also available in: Atom PDF