Class AgentCostTotalQueryResultMapper

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

public class AgentCostTotalQueryResultMapper extends Object implements DashboardComponentQueryResultMapper
Computes the single total cost across all LLM models by combining the input/output/cached token sums from the _flowable_AgentInvocationTokensByModelByTypeQuery query result with the model prices stored in the configuration store for the tenant. The per-model costs are summed into one value.

Reads the same three groupByNestedFieldFilteredWithSumField aggregations as AgentCostByModelQueryResultMapper (inputTokens, outputTokens, cachedTokens) and applies the same per-1,000,000-tokens cost arithmetic with longest-prefix model matching. Models with no matching price are skipped. Returns a SingleValueDashboardComponentData with the total cost.