Class AgentCostTokenService

java.lang.Object
com.flowable.platform.service.dashboard.agent.AgentCostTokenService

public class AgentCostTokenService extends Object
  • Field Details

  • Constructor Details

    • AgentCostTokenService

      public AgentCostTokenService(QueryService queryService, tools.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • getTokenBreakdown

      public AgentCostTokenService.Response getTokenBreakdown(Instant from, Instant to, List<String> agentDefinitionKeys, String tenantId)
    • resolveDataSpan

      public Instant[] resolveDataSpan(List<String> agentDefinitionKeys, String tenantId)
      Resolves the [earliest, latest] invocation start time for the given agent filter, returned as [from, to] Instants, or null when 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

      protected Map<String, AgentCostTokenService.ModelTokens> readBucket(Map<String, tools.jackson.databind.JsonNode> filters, String tenantId)
    • 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

      public static List<AgentCostTokenService.Bucket> computeBuckets(Instant from, Instant to)
    • run

      protected tools.jackson.databind.JsonNode run(String queryKey, String tenantId, Map<String, tools.jackson.databind.JsonNode> filterValuesByType)
    • translateFilterValues

      protected Map<String, tools.jackson.databind.JsonNode> translateFilterValues(QueryDefinitionModel model, Map<String, tools.jackson.databind.JsonNode> filterValuesByType)
    • buildFilterValuesByType

      protected Map<String, tools.jackson.databind.JsonNode> buildFilterValuesByType(Instant from, Instant to, Collection<String> agentDefinitionKeys)