Permalink
Browse files

fix for suppressed items output

  • Loading branch information...
antirez committed Mar 11, 2011
1 parent 08b4f44 commit e57011be5393a714c28b35a480607353e6188359
Showing with 3 additions and 1 deletion.
  1. +3 −1 redis-sampler.rb
View
@@ -94,7 +94,9 @@ def render_freq_table(title,hash)
i = 0
tot = 0
h.each{|k,v| tot += v}
+ partial = 0
h.each{|k,v|
+ partial += v
s = " #{k}: #{v} (#{perc v,tot})"
s += " " * (25 - s.length) if s.length < 25
print s
@@ -104,7 +106,7 @@ def render_freq_table(title,hash)
}
puts "" if i % 3 != 0
if i != h.length
- puts "(suppressed #{h.length-i} items with perc < 0.5% for a total of #{perc @samplesize-tot})"
+ puts "(suppressed #{h.length-i} items with perc < 0.5% for a total of #{perc tot-partial tot})"
end
end

0 comments on commit e57011b

Please sign in to comment.