nutcracker 0.2.4.7 → 0.2.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -3
- data/lib/nutcracker.rb +7 -7
- data/lib/nutcracker/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
This library wraps Twitter's [Nutcracker](https://github.com/twitter/twemproxy) in a gem package and provides a simple ruby API to the `nutcracker` executable.
|
5
5
|
|
6
|
-
###
|
7
|
-
this is still a
|
6
|
+
### Disclaimer
|
7
|
+
this project is still in its early stages, so things could be a little buggy, if you find one, feel free to [report](https://github.com/kontera-technologies/nutcracker/issues) it.
|
8
8
|
|
9
9
|
## Motivation
|
10
10
|
The main motivation here is to take the advantages of working with Bundler's dependencies management and to be able to embed Twitter's [Nutcracker](https://github.com/twitter/twemproxy) as a dependency to any Ruby project, this allow you to create small-configuration-only-apps tied to specific version of Nutcracker as I show in the example bellow.
|
@@ -68,9 +68,12 @@ nutcracker.start
|
|
68
68
|
nutcracker.join # wait for server to exit
|
69
69
|
```
|
70
70
|
|
71
|
-
|
71
|
+
### Building new gems
|
72
72
|
* Set the version @ `lib/nutcracker/version.rb` ( [Available Versions](https://code.google.com/p/twemproxy/downloads/list) )
|
73
73
|
* run the `rake build` command
|
74
74
|
* look for `nutcracker-X.Y.Z` gem under the pkg folder
|
75
75
|
|
76
|
+
### Warranty
|
77
|
+
This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.
|
78
|
+
|
76
79
|
> for more details like licensing etc, please look @ [Nutcracker](https://github.com/twitter/twemproxy)
|
data/lib/nutcracker.rb
CHANGED
@@ -130,14 +130,14 @@ module Nutcracker
|
|
130
130
|
def redis_info url
|
131
131
|
begin
|
132
132
|
redis = Redis.connect(url: url)
|
133
|
-
|
134
|
-
|
133
|
+
info = redis.info
|
134
|
+
db_size = redis.dbsize
|
135
|
+
max_memory = redis.config(:get, 'maxmemory')['maxmemory'].to_i
|
136
|
+
redis.quit
|
137
|
+
rescue Exception
|
138
|
+
return {}
|
135
139
|
end
|
136
|
-
|
137
|
-
info = redis.info
|
138
|
-
db_size = redis.dbsize
|
139
|
-
max_memory = redis.config(:get, 'maxmemory')['maxmemory'].to_i
|
140
|
-
redis.quit
|
140
|
+
|
141
141
|
{
|
142
142
|
'connections' => info['connected_clients'].to_i,
|
143
143
|
'used_memory' => info['used_memory'].to_f,
|
data/lib/nutcracker/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutcracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.4.
|
4
|
+
version: 0.2.4.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
236
236
|
version: '0'
|
237
237
|
segments:
|
238
238
|
- 0
|
239
|
-
hash:
|
239
|
+
hash: -573202003723177898
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project: ruby-nutcracker
|
242
242
|
rubygems_version: 1.8.25
|