Interface StatisticManager

All Known Implementing Classes:
DefaultStatisticManager

public interface StatisticManager
A manager for statistics.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears the statistics.
    default <RESULT, EXCEPTION extends Exception>
    RESULT
    executeSql(Sql<?> sql, ThrowingSupplier<RESULT,EXCEPTION> supplier)
    Executes SQL and records the execution.
    Returns the statistics.
    boolean
    Returns whether this manager is enabled.
    void
    recordSqlExecution(Sql<?> sql, long startTimeNanos, long endTimeNanos)
    Records the execution of SQL.
    void
    setEnabled(boolean enabled)
    Sets whether this manager is enabled.
  • Method Details

    • isEnabled

      boolean isEnabled()
      Returns whether this manager is enabled.
      Returns:
      whether this manager is enabled
    • setEnabled

      void setEnabled(boolean enabled)
      Sets whether this manager is enabled.
      Parameters:
      enabled - whether this manager is enabled
    • getStatistics

      Iterable<Statistic> getStatistics()
      Returns the statistics.
      Returns:
      the statistics
    • recordSqlExecution

      void recordSqlExecution(Sql<?> sql, long startTimeNanos, long endTimeNanos)
      Records the execution of SQL.
      Parameters:
      sql - the SQL
      startTimeNanos - the start time in nanoseconds
      endTimeNanos - the end time in nanoseconds
    • executeSql

      default <RESULT, EXCEPTION extends Exception> RESULT executeSql(Sql<?> sql, ThrowingSupplier<RESULT,EXCEPTION> supplier) throws EXCEPTION
      Executes SQL and records the execution.
      Type Parameters:
      RESULT - the result type
      EXCEPTION - the exception type
      Parameters:
      sql - the SQL
      supplier - the supplier
      Returns:
      the result
      Throws:
      EXCEPTION - the exception
    • clear

      void clear()
      Clears the statistics.