rails_memcached_view 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,126 @@
1
+ %h1 Cache Servers
2
+ - Rails.cache.stats.each do |hostname, stats|
3
+ %h3=hostname
4
+ .container
5
+ .row
6
+ .span4
7
+ %center
8
+ %b Cache Size
9
+ #cache_size{:style => "height: 150px; width: 150px"}
10
+ :javascript
11
+ $(function () {
12
+ var cache_size = [
13
+ { label: "Used Bytes", data: #{stats['bytes']}},
14
+ { label: "Total Bytes", data: #{stats['limit_maxbytes']}}
15
+ ];
16
+ $.plot($('#cache_size'), cache_size, {
17
+ series: { pie: { show: true } },
18
+ legend: { show: false }
19
+ });
20
+ });
21
+ .span4
22
+ %center
23
+ %b Usage
24
+ #cache_usage{:style => "height: 150px; width: 150px"}
25
+ :javascript
26
+ $(function () {
27
+ var cache_size = [
28
+ { label: "Bytes Read", data: #{stats['bytes_read']}},
29
+ { label: "Bytes Written", data: #{stats['bytes_written']}}
30
+ ];
31
+ $.plot($('#cache_usage'), cache_size, {
32
+ series: { pie: { show: true } },
33
+ legend: { show: false }
34
+ });
35
+ });
36
+ .span4
37
+ %center
38
+ %b Hits/Misses
39
+ #cache_hm{:style => "height: 150px; width: 150px"}
40
+ :javascript
41
+ $(function () {
42
+ var cache_size = [
43
+ { label: "Cache Hits", data: #{stats['incr_hits'] + stats['get_hits'] + stats['delete_hits'] + stats['cas_hits'] + stats['decr_hits']}},
44
+ { label: "Cache Misses", data: #{stats['delete_misses'] + stats['cas_misses'] + stats['decr_misses'] + stats['get_misses'] + stats['incr_misses']}}
45
+ ];
46
+ $.plot($('#cache_hm'), cache_size, {
47
+ series: { pie: { show: true } },
48
+ legend: { show: false }
49
+ });
50
+ });
51
+ %table.table.table-condensed.table-bordered
52
+ %tr
53
+ %td PID
54
+ %td= stats['pid']
55
+
56
+ %td Version
57
+ %td= stats['version']
58
+
59
+ %td Cache Flushes
60
+ %td= stats['cmd_flush']
61
+
62
+ %tr
63
+ %td Current Items
64
+ %td= stats['curr_items']
65
+
66
+ %td Total Items
67
+ %td= stats['total_items']
68
+
69
+ %td Threads
70
+ %td= stats['threads']
71
+
72
+ %tr
73
+ %td Delete Misses
74
+ %td= stats['delete_misses']
75
+
76
+ %td CAS Misses
77
+ %td= stats['cas_misses']
78
+
79
+ %td Evictions
80
+ %td= stats['evictions']
81
+
82
+ %tr
83
+ %td Bytes
84
+ %td= number_to_human_size(stats['bytes'])
85
+
86
+ %td Max Byte Limit
87
+ %td= number_to_human_size(stats['limit_maxbytes'])
88
+
89
+ %td Bytes Read / Written
90
+ %td
91
+ = number_to_human_size(stats['bytes_read'])
92
+ \/
93
+ = number_to_human_size(stats['bytes_written'])
94
+
95
+
96
+ %tr
97
+ %td Uptime
98
+ %td= time_ago_in_words(DateTime.now.advance(:seconds => -1*stats['uptime'].to_i))
99
+
100
+ %td Connections
101
+ %td= stats['curr_connections']
102
+
103
+ %td Pointer Size
104
+ %td= stats['pointer_size']
105
+
106
+ %tr
107
+ %td Get Commands
108
+ %td= stats['cmd_get']
109
+
110
+ %td Get Hits
111
+ %td= stats['get_hits']
112
+
113
+ %td Get Misses
114
+ %td= stats['get_misses']
115
+
116
+ %tr
117
+ %td Set Commands
118
+ %td= stats['cmd_set']
119
+
120
+ %td Decr Hits
121
+ %td= stats['decr_hits']
122
+
123
+ %td Decr Misses
124
+ %td= stats['decr_misses']
125
+
126
+
@@ -0,0 +1,6 @@
1
+ require 'rails'
2
+ module RailsMemcachedView
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace RailsMemcachedView
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_memcached_view
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Josh Rendek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-27 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: A simple cache viewer with graphs to see all memcached usage
15
+ email: josh@bluescripts.net
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/rails_memcached_view.rb
21
+ - app/views/rails_memcached_view/_memcached.html.haml
22
+ homepage: https://github.com/bluescripts/rails_memcached_view
23
+ licenses: []
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 1.8.24
43
+ signing_key:
44
+ specification_version: 3
45
+ summary: A simple cache viewer with graphs to see all memcached usage
46
+ test_files: []