Skip to content

Commit

Permalink
fix for suppressed items output
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Mar 11, 2011
1 parent 08b4f44 commit e57011b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redis-sampler.rb
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit e57011b

Please sign in to comment.