Module Core_profiler.Common
val now_no_calibrate : unit -> Core.Time_ns.t
now, possibly with calibration error.
val add_slow_task : t -> (unit -> unit) -> unit
slow_tasks
is a list of functions that should be called rougly every second while the library is in use. The time-since-we-last-did-slow-tasks is checked on every call tonow
andmaybe_do_slow_tasks
below.add_slow_task
adds one more slow task.
val now : t -> reluctance:int -> unit -> Core.Time_ns.t
reluctance
is higher if we don't want to do 'slow tasks' / don't want a potential 300ns spike.We _really_ don't want this in
Group.Point.at
s andDelta_probe.start
s (reluctance:4) since the spike would be included in the calculation of a delta. We'd rather not onTimer.record
s (r:3) since they are more liable to be in the middle of something performance sensitive. We're slightly more happy to calibrate after aGroup.reset
(r:2), but ideally want to calibrate on a call tosafe_to_delay
(r:1; lowest).Here
t
specifies the kind of slow tasks to run if the reluctance has been overcome.
val maybe_do_slow_tasks : t -> reluctance:int -> unit