Class AgentCostByDateQueryResultMapper

java.lang.Object
com.flowable.platform.service.dashboard.resultmapper.extractor.AgentCostByDateQueryResultMapper
All Implemented Interfaces:
DashboardComponentQueryResultMapper

public class AgentCostByDateQueryResultMapper extends Object implements DashboardComponentQueryResultMapper
Computes the total LLM cost per time bucket (a time series for a line chart) by combining per-bucket, per-model token sums with the configured model prices for the tenant.

The dashboard query framework cannot express a single aggregation that groups by both date and model, so this mapper does not use the (single) query result it is given. Instead it resolves the dashboard's date range from the input parameters and delegates to AgentCostTokenService, which already buckets the range by day/week/month and runs the per-model token query once per bucket (the same logic that powers the Control agent timeline). The per-bucket per-model token sums are then priced here.