class Zold::Stress::Summary
Summary
line
Public Class Methods
new(stats, batch = 0)
click to toggle source
# File lib/zold/stress/summary.rb, line 37 def initialize(stats, batch = 0) @stats = stats @batch = batch end
Public Instance Methods
to_s()
click to toggle source
# File lib/zold/stress/summary.rb, line 46 def to_s [ "#{tps.round(2)} tps", %w[update push pull paid arrived].map do |m| if @stats.exists?(m) t = "#{m}: #{@stats.total(m)}/#{Zold::Age.new(Time.now - @stats.avg(m), limit: 2)}" errors = @stats.total(m + '_error') t += errors.zero? ? '' : '/' + Rainbow(errors.to_s).red t else "#{m}: none" end end, "in: #{Zold::Size.new(@stats.sum('input'))}", "out: #{Zold::Size.new(@stats.sum('output'))}" ].join('; ') end
tps()
click to toggle source
# File lib/zold/stress/summary.rb, line 42 def tps @batch / @stats.avg('arrived') end