lib/barnes/instruments/puma_stats_value.rb
# For single worker process use value directly
# for multiple workers use the sum.
#
# https://github.com/puma/puma/pull/1532
For single worker process use value directly
for multiple workers use the sum.


For single worker process use value directly for multiple workers use the sum .
def value
          return stats[key] if single?
          first_worker = stats["worker_status"].first
          return nil unless first_worker && first_worker["last_status"].key?(key)
          value = 0
          stats["worker_status"].each do |worker_status|
            value += worker_status["last_status"][key] || 0
          end
          return value
        end
def value return stats [ key ] if single? first_worker = stats [ "worker_status" ] . first return nil unless first_worker && first_worker [ "last_status" ] . key? ( key ) value = 0 stats [ "worker_status" ] . each do | worker_status | value += worker_status [ "last_status" ] [ key ] || 0 end return value end
For single worker process use value directly
for multiple workers use the sum.
For single worker process use value directly for multiple workers use the sum .