mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
36 lines
842 B
Java
36 lines
842 B
Java
package com.avaje.ebeaninternal.server.autofetch;
|
|
|
|
import java.io.Serializable;
|
|
|
|
/**
|
|
* Used to accumulate query execution statistics.
|
|
*/
|
|
public class StatisticsQuery implements Serializable {
|
|
|
|
private static final long serialVersionUID = -1133958958072778811L;
|
|
|
|
private final String path;
|
|
|
|
private long exeCount;
|
|
|
|
private long totalBeanLoaded;
|
|
|
|
private long totalMicros;
|
|
|
|
public StatisticsQuery(String path){
|
|
this.path = path;
|
|
}
|
|
|
|
public void add(long beansLoaded, long micros) {
|
|
exeCount++;
|
|
totalBeanLoaded += beansLoaded;
|
|
totalMicros += micros;
|
|
}
|
|
|
|
public String toString() {
|
|
long avgMicros = exeCount == 0 ? 0 : totalMicros / exeCount;
|
|
|
|
return "queryExe path["+path+"] count[" + exeCount + "] totalBeansLoaded[" + totalBeanLoaded + "] avgMicros["
|
|
+ avgMicros + "] totalMicros[" + totalMicros + "]";
|
|
}
|
|
} |