2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-04 08:47:37 +08:00

FIX: stop double counting net calls in logs

This commit is contained in:
Sam 2018-02-28 10:45:11 +11:00
parent 2a7b7add59
commit f295a18e94
3 changed files with 29 additions and 2 deletions

View file

@ -5,6 +5,22 @@ describe MethodProfiler do
class Sneetch
def beach
end
def recurse(count = 5)
if count > 0
recurse(count - 1)
end
end
end
it "can bypass recursion on demand" do
MethodProfiler.patch(Sneetch, [:recurse], :recurse, no_recurse: true)
MethodProfiler.start
Sneetch.new.recurse
result = MethodProfiler.stop
expect(result[:recurse][:calls]).to eq(1)
end
it "can transfer data between threads" do