Correctly track hijacked requests

This commit is contained in:
Sam
2017-11-28 16:47:20 +11:00
parent b3b55e18d1
commit df84e1c358
5 changed files with 106 additions and 19 deletions

View File

@ -25,8 +25,14 @@ class MethodProfiler
klass.class_eval patches
end
def self.start
Thread.current[:_method_profiler] = {
def self.transfer
result = Thread.current[:_method_profiler]
Thread.current[:_method_profiler] = nil
result
end
def self.start(transfer = nil)
Thread.current[:_method_profiler] = transfer || {
__start: Process.clock_gettime(Process::CLOCK_MONOTONIC)
}
end