Sha256: 1c35602ee83eb6ec4607a1c16ff1e8ac8839730b7aec6f35acc9ea428ee94d2b

Contents?: true

Size: 860 Bytes

Versions: 2

Compression:

Stored size: 860 Bytes

Contents

module PgBouncerHero
  module Methods
    module Basics
      def summary
        l = lists
        d = databases
        l = l.as_json
        d = d.as_json.reject { |a| a['name'] == 'pgbouncer' }
        l.push({databases_details: d})
        l
      end
      def databases
        connection.exec("SHOW databases")
      end
      def stats
        connection.exec("SHOW stats")
      end
      def lists
        connection.exec("SHOW lists")
      end
      def pools
        connection.exec("SHOW pools")
      end
      def clients
        connection.exec("SHOW clients")
      end
      def conf
        connection.exec("SHOW config")
      end
      def reload
        connection.exec("RELOAD")
      end
      def suspend
        connection.exec("SUSPEND")
      end
      def shutdown
        connection.exec("SHUTDOWN")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pgbouncerhero-0.1.1 lib/pgbouncerhero/methods/basics.rb
pgbouncerhero-0.1.0 lib/pgbouncerhero/methods/basics.rb