poolboy 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +38 -8
- data/lib/poolboy/version.rb +1 -1
- data/lib/poolboy.rb +3 -3
- metadata +1 -1
data/README.md
CHANGED
|
@@ -12,21 +12,51 @@ TODO: Write a gem description
|
|
|
12
12
|
|
|
13
13
|
## Installation
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
$ gem install poolboy
|
|
16
16
|
|
|
17
|
-
gem 'poolboy'
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
## Usage
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Command line options are in the style of the Mysql Client:
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
$ poolboy -h localhost -u root -p password
|
|
23
|
+
Help can be found with --help:
|
|
24
24
|
|
|
25
|
-
$
|
|
25
|
+
$ poolboy --help
|
|
26
|
+
Poolboy helps you inspect your buffer pool
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Usage: poolboy [options]
|
|
29
|
+
-h HOST MySQL hostname
|
|
30
|
+
-u USER MySQL username
|
|
31
|
+
-p PASSWORD MySQL password
|
|
32
|
+
-r REFRESH Refresh interval
|
|
33
|
+
-f Force skipping of Percona Server check
|
|
34
|
+
--help Show this message
|
|
35
|
+
--version Show version
|
|
36
|
+
|
|
37
|
+
All options are optional (obviously) and can be defined in a configuration file for convenience.
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
If you wish to store connection options in a file you can place .poolboy.yaml in your home directory and it will be automatically loaded.
|
|
41
|
+
|
|
42
|
+
The configuration file needs to be in YAML format like so:
|
|
43
|
+
|
|
44
|
+
$ cat ~/.poolboy.yaml
|
|
45
|
+
:host: 127.0.0.1
|
|
46
|
+
:username: root
|
|
47
|
+
:password: kraken123
|
|
48
|
+
:refresh: 5
|
|
49
|
+
:force: false
|
|
50
|
+
|
|
51
|
+
## TODO
|
|
52
|
+
|
|
53
|
+
Add more stats
|
|
54
|
+
|
|
55
|
+
Add tests!
|
|
56
|
+
|
|
57
|
+
Move option parsing into a class
|
|
28
58
|
|
|
29
|
-
|
|
59
|
+
## Quirks/Bugs
|
|
30
60
|
|
|
31
61
|
## Contributing
|
|
32
62
|
|
data/lib/poolboy/version.rb
CHANGED
data/lib/poolboy.rb
CHANGED
|
@@ -51,7 +51,7 @@ module Poolboy
|
|
|
51
51
|
connection = MysqlConnection.new(options)
|
|
52
52
|
if not options[:force]
|
|
53
53
|
connection.percona
|
|
54
|
-
percona = connection.percona ? connection.percona : version_exit
|
|
54
|
+
percona = connection.percona ? connection.percona : version_exit(connection)
|
|
55
55
|
end
|
|
56
56
|
version = connection.version
|
|
57
57
|
case version[0,3]
|
|
@@ -73,12 +73,12 @@ module Poolboy
|
|
|
73
73
|
sleep(options[:refresh])
|
|
74
74
|
end
|
|
75
75
|
rescue SystemExit, Interrupt
|
|
76
|
-
connection.disconnect
|
|
76
|
+
connection.disconnect(connection)
|
|
77
77
|
exit
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
-
def Poolboy.version_exit
|
|
81
|
+
def Poolboy.version_exit(connection)
|
|
82
82
|
puts "Incompatible MySQL version! Poolboy is only compatible with Percona Server 5.1 and 5.5"
|
|
83
83
|
connection.disconnect
|
|
84
84
|
exit 1
|