1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package net.sf.jour;
22
23 import net.sf.jour.timer.NativeTimer;
24
25 import org.apache.log4j.spi.LoggingEvent;
26
27
28
29
30
31
32
33
34
35 /***
36 *
37 * Minimized information to be send over wire.
38 *
39 * @author vlads
40 * @version $Revision: 1.2 $ ($Author: vlads $)
41 */
42 public class ProfilerEvent implements java.io.Serializable {
43
44 private int eventType;
45 private double timeStamp;
46 private double elapsedTime;
47 private long classID;
48 private long methodID;
49
50
51 private Object identifier;
52
53 public ProfilerEvent(Object identifier) {
54 this.timeStamp = NativeTimer.getTime();
55 }
56
57 public ProfilerEvent(ProfilerEvent startEvent) {
58 this.timeStamp = NativeTimer.getTime();
59 this.elapsedTime = startEvent.timeStamp - this.timeStamp;
60 }
61
62 public ProfilerEvent(long clazzID, long methodID) {
63 this.classID = clazzID;
64 this.methodID = methodID;
65 this.timeStamp = NativeTimer.getTime();
66 }
67
68
69
70
71
72
73
74
75
76
77
78 /***
79 * @return Returns the classID.
80 */
81 public long getClassID() {
82 return classID;
83 }
84
85 /***
86 * @return Returns the eventType.
87 */
88 public int getEventType() {
89 return eventType;
90 }
91 /***
92 * @return Returns the methodID.
93 */
94 public long getMethodID() {
95 return methodID;
96 }
97 /***
98 * @return Returns the timeStamp.
99 */
100 public double getTimeStamp() {
101 return timeStamp;
102 }
103 /***
104 * @return Returns the elapsedTime.
105 */
106 public double getElapsedTime() {
107 return elapsedTime;
108 }
109 /***
110 * @return Returns the identifier.
111 */
112 public Object getIdentifier() {
113 return identifier;
114 }
115 /***
116 * @return Returns the stackTrace.
117 */
118
119
120
121
122
123
124 }