Sha256: a53e1368f6129b73b128082fd7828110c2f6ca9e6470193934557c7e3bb3a49d

Contents?: true

Size: 670 Bytes

Versions: 32

Compression:

Stored size: 670 Bytes

Contents

module Marty::Diagnostic; class Connections < Base
  self.aggregatable = false
  diagnostic_fn do
    conns = Node.get_postgres_connections[Database.db_name].
              sort_by{|h| [h['application_name'],
                           h['pid'],
                           h['client_addr'],
                           h['state']]}

    counts = Hash.new(0)
    conns.each_with_object({}) do |c, h|
      c['client_addr'] = 'localhost' unless c['client_addr']
      name = c['application_name']
      counts[name] += 1
      key = "#{name} #{'*' * (counts[name]-1)}"
      h[key] = c.except('application_name').map{|k,v| "<li>#{k}: #{v}</li>"}.join
    end
  end
end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
marty-2.5.2 other/marty/diagnostic/connections.rb
marty-2.5.1 other/marty/diagnostic/connections.rb
marty-2.5.0 other/marty/diagnostic/connections.rb
marty-2.4.9 other/marty/diagnostic/connections.rb
marty-2.4.8 other/marty/diagnostic/connections.rb
marty-2.4.7 other/marty/diagnostic/connections.rb
marty-2.4.6 other/marty/diagnostic/connections.rb
marty-2.4.5 other/marty/diagnostic/connections.rb
marty-2.4.4 other/marty/diagnostic/connections.rb
marty-2.4.3 other/marty/diagnostic/connections.rb
marty-2.4.2 other/marty/diagnostic/connections.rb
marty-2.4.1 other/marty/diagnostic/connections.rb
marty-2.4.0 other/marty/diagnostic/connections.rb
marty-2.3.15 other/marty/diagnostic/connections.rb
marty-2.3.14 other/marty/diagnostic/connections.rb
marty-2.3.13 other/marty/diagnostic/connections.rb
marty-2.3.12 other/marty/diagnostic/connections.rb
marty-2.3.11 other/marty/diagnostic/connections.rb
marty-2.3.10 other/marty/diagnostic/connections.rb
marty-2.3.9 other/marty/diagnostic/connections.rb