class LitmusPaper::Metric::UnixSocketUtilization

Attributes

socket_path[R]

Public Class Methods

new(weight, socket_path, maxconn) click to toggle source
# File lib/litmus_paper/metric/unix_socket_utilization.rb, line 8
def initialize(weight, socket_path, maxconn)
  super(weight, maxconn)
  @socket_path = socket_path
end

Public Instance Methods

_stats() click to toggle source
# File lib/litmus_paper/metric/unix_socket_utilization.rb, line 13
def _stats
  Raindrops::Linux.unix_listener_stats([socket_path])[socket_path]
end
to_s() click to toggle source
# File lib/litmus_paper/metric/unix_socket_utilization.rb, line 17
def to_s
  current_stats = stats
  active = current_stats[:socket_active]
  queued = current_stats[:socket_queued]
  utilization = current_stats[:socket_utilization]

  "Metric::UnixSocketUtilization(weight: #{weight}, maxconn: #{maxconn}, active: #{active}, queued: #{queued}, utilization: #{utilization}, path: #{socket_path})"
end