Пример #1
0
 @Override
 public synchronized String toString() {
   return STAND_ALONE_ENTRY_FORMAT.format(
       new Object[] {
         query == null ? "TOTALS" : query,
         numQueries,
         (queriesPrepared - queriesCompiled) / (double) queriesPrepared,
         queryTime,
         queryCompilationTime,
         queryPreparationTime,
         queryRunTime,
         queryTime * 1000 / numQueries,
         queriesCompiled == 0 ? 0 : queryCompilationTime * 1000 / queriesCompiled,
         queriesPrepared == 0 ? 0 : queryPreparationTime * 1000 / queriesPrepared,
         queriesRun == 0 ? 0 : queryRunTime * 1000 / queriesRun
       });
 }
Пример #2
0
 public synchronized String toString(int maxCountLength, double totalDuration) {
   String formattedCount =
       String.format("%" + maxCountLength + "s", COUNT_FORMAT.format(numQueries));
   return FULL_ENTRY_FORMAT.format(
       new Object[] {
         query == null ? "TOTALS" : query,
         formattedCount,
         (queriesPrepared - queriesCompiled) / (double) queriesPrepared,
         queryTime,
         queryCompilationTime,
         queryPreparationTime,
         queryRunTime,
         queryTime * 1000 / numQueries,
         queriesCompiled == 0 ? 0 : queryCompilationTime * 1000 / queriesCompiled,
         queriesPrepared == 0 ? 0 : queryPreparationTime * 1000 / queriesPrepared,
         queriesRun == 0 ? 0 : queryRunTime * 1000 / queriesRun,
         queryTime / totalDuration
       });
 }