Class AgentCostTokenService
java.lang.Object
com.flowable.platform.service.dashboard.agent.AgentCostTokenService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAgentCostTokenService(QueryService queryService, tools.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccumulate(tools.jackson.databind.JsonNode aggs, String aggName, Map<String, AgentCostTokenService.ModelTokens> perModel, com.flowable.platform.service.dashboard.agent.AgentCostTokenService.LongSetter setter) buildFilterValuesByType(Instant from, Instant to, Collection<String> agentDefinitionKeys) static List<AgentCostTokenService.Bucket> computeBuckets(Instant from, Instant to) protected Map<String, AgentCostTokenService.ModelTokens> readBucket(Map<String, tools.jackson.databind.JsonNode> filters, String tenantId) Instant[]resolveDataSpan(List<String> agentDefinitionKeys, String tenantId) Resolves the [earliest, latest] invocation start time for the given agent filter, returned as[from, to]Instants, ornullwhen there is no matching data.protected tools.jackson.databind.JsonNoderun(String queryKey, String tenantId, Map<String, tools.jackson.databind.JsonNode> filterValuesByType) translateFilterValues(QueryDefinitionModel model, Map<String, tools.jackson.databind.JsonNode> filterValuesByType)
-
Field Details
-
QUERY_TOKENS_BY_MODEL_BY_TYPE
- See Also:
-
QUERY_START_TIME_BOUNDS
- See Also:
-
TYPE_AGENT_DEFINITIONS
- See Also:
-
TYPE_START_TIME
- See Also:
-
TYPE_END_TIME
- See Also:
-
MAX_BUCKETS
protected static final int MAX_BUCKETS- See Also:
-
queryService
-
objectMapper
protected final tools.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
AgentCostTokenService
public AgentCostTokenService(QueryService queryService, tools.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
getTokenBreakdown
-
resolveDataSpan
Resolves the [earliest, latest] invocation start time for the given agent filter, returned as[from, to]Instants, ornullwhen there is no matching data. Used to bucket the full data span when no explicit date range is provided (so a cost-over-time chart shows all data, consistent with the date_histogram-based token charts). The end is nudged by 1ms so the latest invocation falls inside the final bucket. -
readBucket
-
accumulate
protected void accumulate(tools.jackson.databind.JsonNode aggs, String aggName, Map<String, AgentCostTokenService.ModelTokens> perModel, com.flowable.platform.service.dashboard.agent.AgentCostTokenService.LongSetter setter) -
computeBuckets
-
run
-
translateFilterValues
protected Map<String, tools.jackson.databind.JsonNode> translateFilterValues(QueryDefinitionModel model, Map<String, tools.jackson.databind.JsonNode> filterValuesByType) -
buildFilterValuesByType
-