@@ -65,16 +65,16 @@ def instrument(name, payload = {})
65
65
end
66
66
end
67
67
68
- # Returns a "handle" for an event with the given +name+ and +payload+
68
+ # Returns a "handle" for an event with the given +name+ and +payload+.
69
69
#
70
- # + #start+ and + #finish+ must each be called exactly once on the returned object.
70
+ # #start and #finish must each be called exactly once on the returned object.
71
71
#
72
- # Where possible, it's best to use + #instrument+ , which will record the
72
+ # Where possible, it's best to use #instrument, which will record the
73
73
# start and finish of the event and correctly handle any exceptions.
74
74
# +build_handle+ is a low-level API intended for cases where using
75
- # +# instrument+ isn't possible.
75
+ # +instrument+ isn't possible.
76
76
#
77
- # See ActiveSupport::Notifications::Fanout::Handle
77
+ # See ActiveSupport::Notifications::Fanout::Handle.
78
78
def build_handle ( name , payload )
79
79
@notifier . build_handle ( name , @id , payload )
80
80
end
@@ -146,21 +146,21 @@ def finish!
146
146
@allocation_count_finish = now_allocations
147
147
end
148
148
149
- # Returns the CPU time (in milliseconds) passed since the call to
150
- # + start!+ and the call to + finish!+
149
+ # Returns the CPU time (in milliseconds) passed between the call to
150
+ # # start! and the call to # finish!.
151
151
def cpu_time
152
152
@cpu_time_finish - @cpu_time_start
153
153
end
154
154
155
- # Returns the idle time time (in milliseconds) passed since the call to
156
- # + start!+ and the call to + finish!+
155
+ # Returns the idle time time (in milliseconds) passed between the call to
156
+ # # start! and the call to # finish!.
157
157
def idle_time
158
158
diff = duration - cpu_time
159
159
diff > 0.0 ? diff : 0.0
160
160
end
161
161
162
- # Returns the number of allocations made since the call to + start!+ and
163
- # the call to + finish!+
162
+ # Returns the number of allocations made between the call to # start! and
163
+ # the call to # finish!.
164
164
def allocations
165
165
@allocation_count_finish - @allocation_count_start
166
166
end
0 commit comments