Skip to content

feat: GetSumLastNStatVOs batch request (2.7) - #1

Merged
mjfelis merged 1 commit into
mainfrom
feat/sum-last-n-batch
Aug 29, 2026
Merged

feat: GetSumLastNStatVOs batch request (2.7)#1
mjfelis merged 1 commit into
mainfrom
feat/sum-last-n-batch

Conversation

@mjfelis

@mjfelis mjfelis commented Aug 29, 2026

Copy link
Copy Markdown
Member

What

New request class GetSumLastNStatVOs — the batch variant of GetSumLastNStatVO: the sum of the last n units of one statClass / statGranularity for a list of entityIds in one call. The answer is a List<StatVO>, one per requested entityId (entityId set on each, zeros when the entity has no stats).

Version bumped 2.6 → 2.7.

Why

pm-model's ListCampaignSchedulesRequest (scheduler calendar) called /stats/sumLastNStatVO twice per campaign schedule — ~3,000 HTTP calls for 1,500 schedules. This is the API half of replacing that with two calls per list request.

Consumers:

  • mobiera/stats — POST /stats/sumLastNStatVOs (PR opened alongside this one)
  • mobiera/mno-adapters-pm-model — scheduler list uses the batch call, with a fallback to the per-entity call while the stats service is older

Notes

  • Opening this PR triggers the mvn deploy in ci.yml (pull_request_target), which is what publishes 2.7 for the stats / pm-model builds.
  • Built locally with JDK 17 (Lombok 1.18.30 does not run on newer JDKs).

Batch variant of GetSumLastNStatVO: the sum of the last n units of one
statClass / granularity for a list of entityIds in one call. The answer is
a list of StatVO, one per requested entityId. Used by
POST /stats/sumLastNStatVOs (stats >= 5.3) and pm-model's scheduler list.
@mjfelis
mjfelis merged commit 856fe6e into main Aug 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant