Skip to content

Instantly share code, notes, and snippets.

@navyxliu
Created March 19, 2024 04:21
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 navyxliu/e4153245695bdcfd6eab38be36538d8f to your computer and use it in GitHub Desktop.
Save navyxliu/e4153245695bdcfd6eab38be36538d8f to your computer and use it in GitHub Desktop.
A scripp to count how many messages are dropped.
#!/usr/bin/env ruby
lines = ARGF.readlines
total = 0
lines.each do |line|
if line =~ /(\d+)\smessages dropped due to async logging/
num = $1.to_i
total = total + num
#print line
end
end
puts "#{total}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment