Class DataQueryCollector

java.lang.Object
com.vaadin.observability.micrometer.insights.DataQueryCollector

public class DataQueryCollector extends Object
Captures data provider queries worth surfacing: ones that threw, and ones slower than the UX budget.

InteractionCollector cannot see these. It hangs off the RPC events, and the invocation that triggers a load only registers a flush, so a combo box that takes four seconds to fetch a page ends its invocation in microseconds and never qualifies as a slow interaction. This collector watches the queries themselves.

The budget is the same InteractionCollector.UX_BUDGET_MS an interaction is measured against: a query is part of what the user waits for, so it earns attention at the same point.

Threading. The events of one query arrive on the same thread, so the start time lives in a thread local. Count and fetch keep separate slots because an asynchronous component runs its fetches on its own executor while its counts stay on the request thread.

  • Constructor Details

  • Method Details

    • register

      public com.vaadin.flow.shared.Registration register(com.vaadin.flow.server.VaadinServiceEventBus eventBus)
      Subscribes to the data query events on the given bus.
      Parameters:
      eventBus - the service event bus to listen on
      Returns:
      a handle removing every subscription made here