public class StatementStatistics extends Object implements Comparable<StatementStatistics>
| Modifier and Type | Field and Description |
|---|---|
static boolean |
with_parameters
If true the statistics are per statement and parameters, else only per statement.
|
| Constructor and Description |
|---|
StatementStatistics(String sql,
String txName,
Map<Integer,Object> parameters)
Create a statistics collector.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clearStatistics()
Clears the counters.
|
static void |
collect(StatementHistory history)
Collects the statistics from a statement history.
|
int |
compareTo(StatementStatistics o) |
void |
countInvocation(Duration duration)
Count the invocation of a statement.
|
boolean |
equals(Object obj) |
Map<Integer,Object> |
getParameters()
Gets the parameters.
|
static long |
getSince()
Gets the time when counting started.
|
String |
getSql()
Gets the SQL string.
|
StatisticsResult |
getStatistics()
Gets the collected statistics result.
|
static Set<StatementStatistics> |
getStatistics(boolean clear)
Gets the current statistics.
|
String |
getTxName()
Gets the transaction name.
|
int |
hashCode() |
static void |
log(Logger logger,
Logger.Level level,
boolean clear)
Logs the statics.
|
String |
toString() |
public static boolean with_parameters
public static void collect(StatementHistory history)
history - the history to collectpublic static Set<StatementStatistics> getStatistics(boolean clear)
clear - true if clearpublic static void clearStatistics()
public static long getSince()
public static void log(Logger logger, Logger.Level level, boolean clear)
logger - the loggerlevel - the logging levelclear - true if clear after logpublic void countInvocation(Duration duration)
duration - the execution time in millisecondspublic StatisticsResult getStatistics()
public Map<Integer,Object> getParameters()
public String getSql()
public String getTxName()
public int compareTo(StatementStatistics o)
compareTo in interface Comparable<StatementStatistics>Copyright © 2016 Krake Softwaretechnik. All rights reserved.