| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.rice.ken.util; |
| 17 |
|
|
| 18 |
|
import org.apache.commons.lang.time.DurationFormatUtils; |
| 19 |
|
import org.apache.commons.lang.time.StopWatch; |
| 20 |
|
import org.apache.log4j.Logger; |
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
@author |
| 25 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 1 |
|
| 26 |
|
public final class PerformanceLog { |
| 27 |
|
private static final Logger LOG = Logger.getLogger("Performance"); |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@author |
| 32 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 33 |
|
public static final class PerformanceStopWatch { |
| 34 |
|
private StopWatch stopWatch = new StopWatch(); |
| 35 |
|
private String message; |
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
@param |
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 41 |
0
|
public PerformanceStopWatch(String message) {... |
| 42 |
0
|
this.message = message; |
| 43 |
0
|
stopWatch.start(); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
0
|
public void recordDuration() {... |
| 50 |
0
|
logDuration(message, stopWatch.getTime()); |
| 51 |
|
} |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
| 56 |
|
@return |
| 57 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 58 |
0
|
public static Logger getInstance() {... |
| 59 |
0
|
return LOG; |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
|
| 63 |
|
|
| 64 |
|
@param |
| 65 |
|
@return |
| 66 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 67 |
0
|
public static PerformanceStopWatch startTimer(String message) {... |
| 68 |
0
|
return new PerformanceStopWatch(message); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
@param |
| 74 |
|
@param |
| 75 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 76 |
0
|
public static void logDuration(String message, long duration) {... |
| 77 |
0
|
LOG.info(message + ": " + DurationFormatUtils.formatDurationHMS(duration) + " (" + duration+ " ms)"); |
| 78 |
|
} |
| 79 |
|
} |