Task #6122
closedTask #6116: EPIC: Speed up the stats updater daemon (scripts/workflow/update_stats.sh)
Stop printing full IIKO response payloads to stdout
100%
Description
Problem¶
The fetchers println entire response bodies:
-
IikoOlapV2RequestsFetchingService.fetchOlapData:55—println(responseBody), the whole OLAP report -
IikoServerEmployeesFetchingService.fetchEmployees—println(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— severalprintlns 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 atDEBUG. - 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.
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.xml — info, так что по умолчанию payload'ы в nohup.out не идут.