
19 Nov
2020
19 Nov
'20
1:10 p.m.
On Wed, Nov 18, 2020 at 06:33:55PM +0800, Luan Shengde wrote:
#!/usr/bin/env ruby
while (line = STDIN.gets) - case line.chomp! - when /transactions:\s+(\d+)/ - puts "transactions: #{$1}" - when /95th percentile:\s+(\S+)/ - puts "95th percentile: #{$1}" - end + case line.chomp! + when /transactions:\s+(\d+)/
no need to add chomp! for the lineif not match /xxx$/
Thanks, Luan Shengde
Good! Thanks, Yale
+ puts "transactions: #{$1}" + when /95th percentile:\s+(\S+)/ + puts "95th percentile: #{$1}" + end end -- 2.23.0