Class LocalQueryStatistics

java.lang.Object
org.infinispan.query.core.stats.impl.LocalQueryStatistics
All Implemented Interfaces:
JsonSerialization, QueryStatistics, QueryStatisticsSnapshot

@ProtoTypeId(4202) public class LocalQueryStatistics extends Object implements QueryStatisticsSnapshot
Manages query statistics for a Cache.
Since:
12.0
  • Constructor Details

    • LocalQueryStatistics

      public LocalQueryStatistics()
  • Method Details

    • localIndexedQueryExecuted

      public void localIndexedQueryExecuted(String q, long timeNanos)
    • distributedIndexedQueryExecuted

      public void distributedIndexedQueryExecuted(String q, long timeNanos)
    • hybridQueryExecuted

      public void hybridQueryExecuted(String q, long timeNanos)
    • nonIndexedQueryExecuted

      public void nonIndexedQueryExecuted(String q, long timeNanos)
    • entityLoaded

      public void entityLoaded(long timeNanos)
    • getLocalIndexedQueryCount

      public long getLocalIndexedQueryCount()
      Specified by:
      getLocalIndexedQueryCount in interface QueryStatistics
      Returns:
      Number of queries executed in the local index.
    • getDistributedIndexedQueryCount

      public long getDistributedIndexedQueryCount()
      Specified by:
      getDistributedIndexedQueryCount in interface QueryStatistics
      Returns:
      Number of distributed indexed queries executed from the local node.
    • getHybridQueryCount

      public long getHybridQueryCount()
      Specified by:
      getHybridQueryCount in interface QueryStatistics
      Returns:
      Number of hybrid queries (two phase indexed and non-indexed) executed from the local node.
    • getNonIndexedQueryCount

      public long getNonIndexedQueryCount()
      Specified by:
      getNonIndexedQueryCount in interface QueryStatistics
      Returns:
      Number of non-indexed queries executed from the local node.
    • getLocalIndexedQueryTotalTime

      public long getLocalIndexedQueryTotalTime()
      Specified by:
      getLocalIndexedQueryTotalTime in interface QueryStatistics
      Returns:
      The total time in nanoseconds of all indexed queries.
    • getDistributedIndexedQueryTotalTime

      public long getDistributedIndexedQueryTotalTime()
      Specified by:
      getDistributedIndexedQueryTotalTime in interface QueryStatistics
      Returns:
      The total time in nanoseconds of all distributed indexed queries.
    • getHybridQueryTotalTime

      public long getHybridQueryTotalTime()
      Specified by:
      getHybridQueryTotalTime in interface QueryStatistics
      Returns:
      The total time in nanoseconds for all hybrid queries.
    • getNonIndexedQueryTotalTime

      public long getNonIndexedQueryTotalTime()
      Specified by:
      getNonIndexedQueryTotalTime in interface QueryStatistics
      Returns:
      The total time in nanoseconds for all non-indexed queries.
    • getLocalIndexedQueryMaxTime

      public long getLocalIndexedQueryMaxTime()
      Specified by:
      getLocalIndexedQueryMaxTime in interface QueryStatistics
      Returns:
      The time in nanoseconds of the slowest indexed query.
    • getDistributedIndexedQueryMaxTime

      public long getDistributedIndexedQueryMaxTime()
      Specified by:
      getDistributedIndexedQueryMaxTime in interface QueryStatistics
      Returns:
      The time in nanoseconds of the slowest distributed indexed query.
    • getHybridQueryMaxTime

      public long getHybridQueryMaxTime()
      Specified by:
      getHybridQueryMaxTime in interface QueryStatistics
      Returns:
      The time in nanoseconds of the slowest hybrid query.
    • getNonIndexedQueryMaxTime

      public long getNonIndexedQueryMaxTime()
      Specified by:
      getNonIndexedQueryMaxTime in interface QueryStatistics
      Returns:
      The time in nanoseconds of the slowest non-indexed query.
    • getLocalIndexedQueryAvgTime

      public double getLocalIndexedQueryAvgTime()
      Specified by:
      getLocalIndexedQueryAvgTime in interface QueryStatistics
      Returns:
      The average time in nanoseconds of all indexed queries.
    • getDistributedIndexedQueryAvgTime

      public double getDistributedIndexedQueryAvgTime()
      Specified by:
      getDistributedIndexedQueryAvgTime in interface QueryStatistics
      Returns:
      The average time in nanoseconds of all distributed indexed queries.
    • getHybridQueryAvgTime

      public double getHybridQueryAvgTime()
      Specified by:
      getHybridQueryAvgTime in interface QueryStatistics
      Returns:
      The average time in nanoseconds of all hybrid indexed queries.
    • getNonIndexedQueryAvgTime

      public double getNonIndexedQueryAvgTime()
      Specified by:
      getNonIndexedQueryAvgTime in interface QueryStatistics
      Returns:
      The average time in nanoseconds of all non-indexed indexed queries.
    • getSlowestLocalIndexedQuery

      public String getSlowestLocalIndexedQuery()
      Specified by:
      getSlowestLocalIndexedQuery in interface QueryStatistics
      Returns:
      The Ickle query string of the slowest indexed query.
    • getSlowestDistributedIndexedQuery

      public String getSlowestDistributedIndexedQuery()
      Specified by:
      getSlowestDistributedIndexedQuery in interface QueryStatistics
      Returns:
      The Ickle query string of the slowest distributed indexed query.
    • getSlowestHybridQuery

      public String getSlowestHybridQuery()
      Specified by:
      getSlowestHybridQuery in interface QueryStatistics
      Returns:
      The Ickle query string of the slowest hybrid query.
    • getSlowestNonIndexedQuery

      public String getSlowestNonIndexedQuery()
      Specified by:
      getSlowestNonIndexedQuery in interface QueryStatistics
      Returns:
      The Ickle query string of the slowest non-indexed query.
    • getLoadMaxTime

      public long getLoadMaxTime()
      Specified by:
      getLoadMaxTime in interface QueryStatistics
      Returns:
      The max time in nanoseconds to load entities from a Cache after an indexed query.
    • getLoadAvgTime

      public double getLoadAvgTime()
      Specified by:
      getLoadAvgTime in interface QueryStatistics
      Returns:
      The average time in nanoseconds to load entities from a Cache after an indexed query.
    • getLoadCount

      public long getLoadCount()
      Specified by:
      getLoadCount in interface QueryStatistics
      Returns:
      The number of entities loaded from a Cache after an indexed query.
    • getLoadTotalTime

      public long getLoadTotalTime()
      Specified by:
      getLoadTotalTime in interface QueryStatistics
      Returns:
      The total time to load entities from a Cache after an indexed query.
    • getLocalIndexedQueries

      protected org.infinispan.query.core.stats.impl.QueryMetrics getLocalIndexedQueries()
    • getDistIndexedQueries

      protected org.infinispan.query.core.stats.impl.QueryMetrics getDistIndexedQueries()
    • getHybridQueries

      protected org.infinispan.query.core.stats.impl.QueryMetrics getHybridQueries()
    • getNonIndexedQueries

      protected org.infinispan.query.core.stats.impl.QueryMetrics getNonIndexedQueries()
    • getLoads

      public org.infinispan.query.core.stats.impl.QueryMetrics getLoads()
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface QueryStatistics
      Returns:
      true if the Cache has statistics enabled.
    • computeSnapshot

      public CompletionStage<QueryStatisticsSnapshot> computeSnapshot()
      Specified by:
      computeSnapshot in interface QueryStatistics
      Specified by:
      computeSnapshot in interface QueryStatisticsSnapshot
      Returns:
      A snapshot of self.
    • clear

      public void clear()
      Description copied from interface: QueryStatistics
      Clear all statistics.
      Specified by:
      clear in interface QueryStatistics
    • merge

      Description copied from interface: QueryStatisticsSnapshot
      Merge with another QueryStatisticsSnapshot
      Specified by:
      merge in interface QueryStatisticsSnapshot
      Returns:
      self.
    • toJson

      public Json toJson()
      Specified by:
      toJson in interface JsonSerialization
    • toString

      public String toString()
      Overrides:
      toString in class Object