Skip to content

Instantly share code, notes, and snippets.

@shibafu528
Created September 26, 2020 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shibafu528/462a297f1d78ec8f39069a83fc9f8d50 to your computer and use it in GitHub Desktop.
Save shibafu528/462a297f1d78ec8f39069a83fc9f8d50 to your computer and use it in GitHub Desktop.
Plugin.create :delayer_high_water_marker
Delayer.default.instance_eval do
alias run_once_dhwm run_once
def run_once(...)
s1 = size_norec
res = run_once_dhwm(...)
s2 = size_norec
warn "delayer tasks #{s1} -> #{s2}"
res
end
def size_norec
size = 0
node = @bucket.first
while node
size += 1
node = node.next
end
size
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment