Skip to content

Commit

Permalink
line tp
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Aug 12, 2024
1 parent 1fcf2d6 commit 31cd227
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/datadog/di/hook_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def hook_line_now(file, line_no, &block)
puts '/////////// untargeted /////////////'
end

tp.enable(target: iseq)
tp.enable(target: iseq, target_line: line_no)
end
end

Expand Down Expand Up @@ -275,8 +275,11 @@ def symbolize_class_name(cls_name)
end

def on_line_trace_point(tp, **opts)
cb = instrumented_lines[tp.lineno]&.[](File.basename(tp.path))
cb&.call(tp, **opts)
time = Benchmark.realtime do
cb = instrumented_lines[tp.lineno]&.[](File.basename(tp.path))
cb&.call(tp, **opts)
end
puts "-- invocation time: #{time} #{tp.path}:#{tp.lineno}"
end
end
end
Expand Down

0 comments on commit 31cd227

Please sign in to comment.