1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.monitor.api; |
21 |
|
|
|
|
| 0% |
Uncovered Elements: 28 (28) |
Complexity: 8 |
Complexity Density: 0.4 |
|
22 |
|
public class MonitorTimerSummary |
23 |
|
{ |
24 |
|
private String name; |
25 |
|
|
26 |
|
private long duration = 0; |
27 |
|
|
28 |
|
private long nbcalls = 0; |
29 |
|
|
30 |
|
private long nbrequests = 0; |
31 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
32 |
0 |
public MonitorTimerSummary(String name)... |
33 |
|
{ |
34 |
0 |
this.name = name; |
35 |
|
} |
36 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
37 |
0 |
public String getName()... |
38 |
|
{ |
39 |
0 |
return this.name; |
40 |
|
} |
41 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
42 |
0 |
public void addTimer(long duration)... |
43 |
|
{ |
44 |
0 |
this.duration += duration; |
45 |
0 |
this.nbcalls++; |
46 |
0 |
this.nbrequests = 1; |
47 |
|
} |
48 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
0 |
public long getDuration()... |
50 |
|
{ |
51 |
0 |
return this.duration; |
52 |
|
} |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
public long getNbCalls()... |
55 |
|
{ |
56 |
0 |
return this.nbcalls; |
57 |
|
} |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
59 |
0 |
public void add(MonitorTimerSummary stimer)... |
60 |
|
{ |
61 |
0 |
this.duration += stimer.getDuration(); |
62 |
0 |
this.nbcalls += stimer.getNbCalls(); |
63 |
0 |
this.nbrequests++; |
64 |
|
} |
65 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
0 |
public long getRequests()... |
67 |
|
{ |
68 |
0 |
return this.nbrequests; |
69 |
|
} |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 1 |
Complexity Density: 0.11 |
|
71 |
0 |
@Override... |
72 |
|
public String toString() |
73 |
|
{ |
74 |
0 |
StringBuffer str = new StringBuffer(); |
75 |
0 |
str.append(this.name); |
76 |
0 |
str.append(": duration="); |
77 |
0 |
str.append(getDuration()); |
78 |
0 |
str.append(" nbcalls="); |
79 |
0 |
str.append(getNbCalls()); |
80 |
0 |
str.append(" nbrequests="); |
81 |
0 |
str.append(getRequests()); |
82 |
0 |
return str.toString(); |
83 |
|
} |
84 |
|
} |