Sha256: c5ec5c3dd39263203e6b2d5bc9c30fd5158fa24382096b015f88892fe73542d5

Contents?: true

Size: 906 Bytes

Versions: 4

Compression:

Stored size: 906 Bytes

Contents

module PgBouncerHero
  module Methods
    module Basics
      def summary
        if connection
          l = lists
          d = databases
          l = l.as_json
          d = d.as_json.reject { |a| a['name'] == 'pgbouncer' }
          l.push({databases_details: d})
          l
        end
      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

4 entries across 4 versions & 1 rubygems

Version Path
pgbouncerhero-2.0.0 lib/pgbouncerhero/methods/basics.rb
pgbouncerhero-1.0.3 lib/pgbouncerhero/methods/basics.rb
pgbouncerhero-1.0.1 lib/pgbouncerhero/methods/basics.rb
pgbouncerhero-1.0.0 lib/pgbouncerhero/methods/basics.rb