redis_dashboard 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/lib/redis_dashboard/application.rb +13 -6
- data/lib/redis_dashboard/views/index.erb +1 -1
- data/lib/redis_dashboard/views/layout.erb +1 -1
- data/lib/redis_dashboard/views/slowlog.erb +2 -2
- data/lib/redis_dashboard/views/stats.erb +3 -3
- data/redis_dashboard.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77f7bba022a91fd2ecc4e3a04bc6e681941ae6e6
|
4
|
+
data.tar.gz: 9c8356bfc9dc1ed4f1c86f7d538062bfd0a3474e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 519dcddb89f59ac645ab7f194cdc7f31564d40bf69879a4fda2d955a608ecf3a15d21307d046827c5a47e8cea57b047eb95e033a6bdf005d0822bdb6a0f69cbd
|
7
|
+
data.tar.gz: 46b0949f00f5dcf0cf192b44b3efd1ddd59fa78720f099a2eb469244ec746b3073018119f322ecba4ca412e445bf7dc6c223ef4badf9efd8135855cb10bf8767
|
@@ -3,6 +3,9 @@ require "redis"
|
|
3
3
|
require "uri"
|
4
4
|
|
5
5
|
class RedisDashboard::Application < Sinatra::Base
|
6
|
+
require "erubis"
|
7
|
+
set :erb, escape_html: true
|
8
|
+
|
6
9
|
after { close_clients }
|
7
10
|
|
8
11
|
get "/" do
|
@@ -74,8 +77,10 @@ class RedisDashboard::Application < Sinatra::Base
|
|
74
77
|
end
|
75
78
|
|
76
79
|
def compute_cache_hit_ratio(info)
|
77
|
-
|
78
|
-
|
80
|
+
hits = info["keyspace_hits"].to_i
|
81
|
+
misses = info["keyspace_misses"].to_i
|
82
|
+
if (total = hits + misses) > 0
|
83
|
+
hits * 100.0 / total
|
79
84
|
else
|
80
85
|
0
|
81
86
|
end
|
@@ -83,7 +88,7 @@ class RedisDashboard::Application < Sinatra::Base
|
|
83
88
|
|
84
89
|
def clients_column_description(col)
|
85
90
|
# https://redis.io/commands/client-list
|
86
|
-
{
|
91
|
+
@clients_column_description ||= {
|
87
92
|
id: "an unique 64-bit client ID (introduced in Redis 2.8.12).",
|
88
93
|
addr: "address/port of the client",
|
89
94
|
fd: "file descriptor corresponding to the socket",
|
@@ -101,12 +106,13 @@ class RedisDashboard::Application < Sinatra::Base
|
|
101
106
|
omem: "output buffer memory usage",
|
102
107
|
events: "file descriptor events (see below)",
|
103
108
|
cmd: "last command played",
|
104
|
-
}
|
109
|
+
}
|
110
|
+
@clients_column_description[col.to_sym]
|
105
111
|
end
|
106
112
|
|
107
113
|
def client_event_description(event)
|
108
114
|
# https://redis.io/commands/client-list
|
109
|
-
{
|
115
|
+
@client_event_description ||= {
|
110
116
|
O: "the client is a slave in MONITOR mode",
|
111
117
|
S: "the client is a normal slave server",
|
112
118
|
M: "the client is a master",
|
@@ -120,7 +126,8 @@ class RedisDashboard::Application < Sinatra::Base
|
|
120
126
|
r: "the client is in readonly mode against a cluster node",
|
121
127
|
A: "connection to be closed ASAP",
|
122
128
|
N: "no specific flag set",
|
123
|
-
}
|
129
|
+
}
|
130
|
+
@client_event_description[event.to_sym]
|
124
131
|
end
|
125
132
|
end
|
126
133
|
end
|
@@ -24,7 +24,7 @@
|
|
24
24
|
</div>
|
25
25
|
<% end %>
|
26
26
|
</div>
|
27
|
-
|
27
|
+
<%== yield %>
|
28
28
|
<div class="page-footer">
|
29
29
|
Made by <a href="https://basesecrete.com/en/">Base Secrète</a>. MIT License. <a href="https://github.com/BaseSecrete/redis_dashboard">Fork on GitHub</a>.
|
30
30
|
<div class="rorvswild">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<p>
|
2
|
-
List up to <%= client.config["slowlog-max-len"] %> commands slower than
|
2
|
+
List up to <%= client.config["slowlog-max-len"] %> commands slower than <%== format_usec client.config["slowlog-log-slower-than"] %>.
|
3
3
|
It is defined in your config by <em>slowlog-max-len</em> and <em>slowlog-log-slower-than</em>.
|
4
4
|
</p>
|
5
5
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<tr>
|
17
17
|
<td><%= cmd.id %></td>
|
18
18
|
<td class="date"><%= epoch_to_short_date_time cmd.timestamp %></td>
|
19
|
-
<td class="number"
|
19
|
+
<td class="number"><%== format_usec cmd.microseconds %></td>
|
20
20
|
<td><%= cmd.command.join(" ") %></td>
|
21
21
|
</tr>
|
22
22
|
<% end %>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<% for (key,hash) in stats %>
|
11
11
|
<tr>
|
12
12
|
<td class="key"><%= key %></td>
|
13
|
-
<td class="number"
|
13
|
+
<td class="number"><%== format_usec hash["usec"] %></td>
|
14
14
|
<td class="number"><%= hash["calls"] %></td>
|
15
|
-
<td class="number"
|
16
|
-
<td class="number"
|
15
|
+
<td class="number"><%== format_usec hash["usec_per_call"] %></td>
|
16
|
+
<td class="number"><%== format_impact_percentage hash["impact"] %></td>
|
17
17
|
</tr>
|
18
18
|
<% end %>
|
19
19
|
</table>
|
data/redis_dashboard.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = "redis_dashboard"
|
6
|
-
spec.version = "0.1.
|
6
|
+
spec.version = "0.1.5"
|
7
7
|
spec.authors = ["Alexis Bernard"]
|
8
8
|
spec.email = ["alexis@bernard.io"]
|
9
9
|
spec.summary = "Sinatra app to monitor Redis servers."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_dashboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|