memcached_stats 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/memcached_stats/base.rb +6 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb7d3b8523d38561f42308aca4abd8fda160fd71
4
- data.tar.gz: f6bcbd334b14fee0a16c22a51d1b5056a65fd66f
3
+ metadata.gz: c31e335f58b4baa5b3252d36b6725e07d053e8da
4
+ data.tar.gz: 6c5e878f256a8e5a7773c77658e2542596b4ad67
5
5
  SHA512:
6
- metadata.gz: d5ba210fc118497116689a2ee235f09d899a1903b8bc2c4e158c34908a892cce60a35d0d8bcab482fdecee0853aa919618eed0d6cf33c6014647d0a6e1c2bd1b
7
- data.tar.gz: 2793035a28ceeab51f4c0a6400ab826d21208c18785f8edffa6496713b8d9701cee876f5ea2981c577092a704947192a016d6ffe911ebfcb456553bd5f105982
6
+ metadata.gz: 5dbbaba0ae7bc8e481ee8bbe4f7f4fc4d0d9807e4c2967bd4c22506167a888169155d23ca2a0b3f9794f5a08bc5e479e159dc6ad0bd0efe1ae4aff49ad3b8ea3
7
+ data.tar.gz: 9022502ff54713d8299521dd8c62601759ae459b7f4d9fcf05b91a9782e4a549910e00efacc3a45895988da7713da0fa2d5175f31fd2c52e80c72b249b5cab13
@@ -75,7 +75,12 @@ class MemcachedStats
75
75
  protected
76
76
 
77
77
  def get_summary
78
- @summary = Hash[*MemcachedStats.service_connection("stats", @host, @port).sub("END\r\n","").each_line.inject([]){|arr, line| arr.push(line.sub("STAT ", "").split(' '))}.flatten]
78
+ stats = []
79
+ MemcachedStats.service_connection("stats", @host, @port).sub("END\r\n","").each_line do |line|
80
+ stats.push(line.sub("STAT ", "").chomp.split(' ', 2))
81
+ end
82
+
83
+ @summary = Hash[*stats.flatten]
79
84
  @summary["hit_ratio"] = @summary["get_hits"].to_f / @summary["cmd_get"].to_f
80
85
  @summary["miss_ratio"] = @summary["get_misses"].to_f / @summary["cmd_get"].to_f
81
86
  @summary["request_rate"] = @summary["cmd_get"].to_f / @summary["uptime"].to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Schneider