Project

General

Profile

Actions

Task #6119

open

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

Spike: ask IIKO OLAP for a date-grouped range in one request instead of one request per day

Added by Redmine Admin about 8 hours ago.

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

0%

Estimated time:

Description

Problem

IikoStatsGatheringService.getMetricValuesFromIikoDateDesc (line 117) loops currentDate backwards in delta steps and issues one OLAP report request per step. For the default delta = 1 day over a year that is 365 requests to obtain what is conceptually a single time series.

Idea

IIKO's OLAP v2 report API supports grouping rows by a date field (OpenDate.Typed and friends) inside one report. If the request DTOs can carry that group field, a whole range collapses into one request whose rows are already the per-day buckets we are building by hand.

This is by far the largest single multiplier available (×365 on the default delta), but it needs verification against the live IIKO server before committing to it.

Work

  1. Confirm against the IIKO server which date group field the configured report types accept, and that the aggregate values per bucket match what the current per-day requests return. Compare a known company/metric/week both ways.
  2. If it holds, extend IikoOlapV2RequestsComposingService / GroupFieldsComposingService to emit the date group field, and add a range-mode path to getMetricValuesFromIikoDateDesc that issues one request and maps each returned row to a StatSliceBase with the bucket's own dateStart/dateEnd.
  3. Keep the per-day path as a fallback for month_cumulative_revenue, whose windows are not uniform buckets and may not express as a simple grouping.

Blocked on nothing, but should land after the session reuse task so the verification runs are cheap.

Acceptance

  • Written finding recorded on this issue either way (works / does not work, with evidence).
  • If it works: a range fetch returns the same slice values as the day-by-day fetch for the same window.

No data to display

Actions

Also available in: Atom PDF