We hook into the v8 garbage collection prologue/epilogue events and
track time spent in between those two calls, along with the number of
times GC is called in between each reporting interval.
The prologue/epilogue hooks are run in the context of the v8 thread,
whereas the reporting is in a separate thread (the monitr thread). For
this reason we need to protect the garbage collection statistics by a
mutex to prevent the reporter getting half-filled GC statistics.
We hook into the v8 garbage collection prologue/epilogue events and track time spent in between those two calls, along with the number of times GC is called in between each reporting interval.
The prologue/epilogue hooks are run in the context of the v8 thread, whereas the reporting is in a separate thread (the monitr thread). For this reason we need to protect the garbage collection statistics by a mutex to prevent the reporter getting half-filled GC statistics.