Record Class Statistic

java.lang.Object
java.lang.Record
org.seasar.doma.jdbc.statistic.Statistic

public record Statistic(String sql, long execCount, long execMaxTime, long execMinTime, long execTotalTime, double execAvgTime) extends Record
Represents a statistic of SQL execution.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Statistic(String sql, long execCount, long execMaxTime, long execMinTime, long execTotalTime, double execAvgTime)
    Creates an instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    calculate(long execTimeMillis)
    Calculates a new instance.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Returns the value of the execAvgTime record component.
    long
    Returns the value of the execCount record component.
    long
    Returns the value of the execMaxTime record component.
    long
    Returns the value of the execMinTime record component.
    long
    Returns the value of the execTotalTime record component.
    final int
    Returns a hash code value for this object.
    static Statistic
    of(String sql, long execTimeMillis)
    Creates an instance.
    sql()
    Returns the value of the sql record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Statistic

      public Statistic(String sql, long execCount, long execMaxTime, long execMinTime, long execTotalTime, double execAvgTime)
      Creates an instance.
      Parameters:
      sql - the SQL
      execCount - the execution count
      execMaxTime - the maximum execution time in milliseconds
      execMinTime - the minimum execution time in milliseconds
      execTotalTime - the total execution time in milliseconds
      execAvgTime - the average execution time in milliseconds
  • Method Details

    • calculate

      public Statistic calculate(long execTimeMillis)
      Calculates a new instance.
      Parameters:
      execTimeMillis - the execution time in milliseconds
      Returns:
      the new instance
    • of

      public static Statistic of(String sql, long execTimeMillis)
      Creates an instance.
      Parameters:
      sql - the SQL
      execTimeMillis - the execution time in milliseconds
      Returns:
      the new instance
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sql

      public String sql()
      Returns the value of the sql record component.
      Returns:
      the value of the sql record component
    • execCount

      public long execCount()
      Returns the value of the execCount record component.
      Returns:
      the value of the execCount record component
    • execMaxTime

      public long execMaxTime()
      Returns the value of the execMaxTime record component.
      Returns:
      the value of the execMaxTime record component
    • execMinTime

      public long execMinTime()
      Returns the value of the execMinTime record component.
      Returns:
      the value of the execMinTime record component
    • execTotalTime

      public long execTotalTime()
      Returns the value of the execTotalTime record component.
      Returns:
      the value of the execTotalTime record component
    • execAvgTime

      public double execAvgTime()
      Returns the value of the execAvgTime record component.
      Returns:
      the value of the execAvgTime record component