redis_dashboard 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile +0 -1
  4. data/Gemfile.lock +9 -13
  5. data/README.md +17 -15
  6. data/lib/redis_dashboard/application.rb +50 -17
  7. data/lib/redis_dashboard/client.rb +20 -3
  8. data/lib/redis_dashboard/public/ariato.css +739 -0
  9. data/lib/redis_dashboard/public/style.css +185 -0
  10. data/lib/redis_dashboard/views/application.scss +2 -10
  11. data/lib/redis_dashboard/views/clients.erb +18 -17
  12. data/lib/redis_dashboard/views/config.erb +6 -7
  13. data/lib/redis_dashboard/views/index.erb +10 -10
  14. data/lib/redis_dashboard/views/info.erb +6 -7
  15. data/lib/redis_dashboard/views/key/hash.erb +12 -0
  16. data/lib/redis_dashboard/views/key/list.erb +11 -0
  17. data/lib/redis_dashboard/views/key/metadata.erb +47 -0
  18. data/lib/redis_dashboard/views/key/set.erb +11 -0
  19. data/lib/redis_dashboard/views/key/string.erb +3 -0
  20. data/lib/redis_dashboard/views/key/unsupported.erb +2 -0
  21. data/lib/redis_dashboard/views/key/zset.erb +16 -0
  22. data/lib/redis_dashboard/views/key.erb +5 -0
  23. data/lib/redis_dashboard/views/keys.erb +26 -0
  24. data/lib/redis_dashboard/views/keyspace.erb +23 -0
  25. data/lib/redis_dashboard/views/layout.erb +34 -29
  26. data/lib/redis_dashboard/views/memory.erb +21 -20
  27. data/lib/redis_dashboard/views/slowlog.erb +25 -24
  28. data/lib/redis_dashboard/views/stats.erb +19 -15
  29. data/lib/redis_dashboard.rb +1 -1
  30. data/redis_dashboard.gemspec +1 -2
  31. data/screenshot.jpg +0 -0
  32. metadata +16 -24
  33. data/lib/redis_dashboard/views/stylesheets/base.scss +0 -17
  34. data/lib/redis_dashboard/views/stylesheets/colors.scss +0 -6
  35. data/lib/redis_dashboard/views/stylesheets/link.scss +0 -20
  36. data/lib/redis_dashboard/views/stylesheets/page.scss +0 -69
  37. data/lib/redis_dashboard/views/stylesheets/server-card.scss +0 -37
  38. data/lib/redis_dashboard/views/stylesheets/table.scss +0 -49
  39. data/lib/redis_dashboard/views/stylesheets/typography.scss +0 -21
@@ -1,30 +1,31 @@
1
- <p>
2
- List up to <%= client.config["slowlog-max-len"] %> commands slower than <%== format_usec client.config["slowlog-log-slower-than"] %>.
3
- It is defined in your config by <em>slowlog-max-len</em> and <em>slowlog-log-slower-than</em>.
4
- </p>
5
-
6
- <div class="table">
1
+ <div class="card">
2
+ <p>
3
+ List up to <%= client.config["slowlog-max-len"] %> commands slower than <%== format_usec client.config["slowlog-log-slower-than"] %>.
4
+ It is defined in your config by <em>slowlog-max-len</em> and <em>slowlog-log-slower-than</em>.
5
+ </p>
7
6
  <table>
8
7
  <thead>
9
- <th>ID</th>
10
- <th>At</th>
11
- <th>Duration</th>
12
- <th>Command</th>
13
- </thead>
14
-
15
- <% for cmd in commands %>
16
8
  <tr>
17
- <td><%= cmd.id %></td>
18
- <td class="date"><%= epoch_to_short_date_time cmd.timestamp %></td>
19
- <td class="number"><%== format_usec cmd.microseconds %></td>
20
- <td><%= cmd.command.join(" ") %></td>
9
+ <th>Command</th>
10
+ <th class="is-right">ID</th>
11
+ <th class="is-right">At</th>
12
+ <th class="is-right">Duration</th>
21
13
  </tr>
22
- <% end %>
14
+ </thead>
15
+ <tbody>
16
+ <% for cmd in commands %>
17
+ <tr>
18
+ <td class="wrap"><%= cmd.command.join(" ") %></td>
19
+ <td class="is-right"><%= cmd.id %></td>
20
+ <td class="is-right date"><%= epoch_to_short_date_time cmd.timestamp %></td>
21
+ <td class="is-right"><%== format_usec cmd.microseconds %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
23
25
  </table>
24
26
  </div>
25
-
26
- <a href="https://redis.io/commands/slowlog">
27
- <svg viewBox="0 0 24 24">
28
- <path d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z" />
29
- </svg> Redis slowlog documentation
30
- </a>
27
+ <div role="alert">
28
+ <a href="https://redis.io/commands/slowlog" target="_blank" rel="noopener nofollower">
29
+ Redis slowlog documentation
30
+ </a>
31
+ </div>
@@ -1,20 +1,24 @@
1
- <div class="table">
1
+ <div class="card">
2
2
  <table>
3
- <tr>
4
- <th>Command</th>
5
- <th>Total time</th>
6
- <th>Calls</th>
7
- <th>AVG time</th>
8
- <th>Impact</th>
9
- </tr>
10
- <% for (key,hash) in stats %>
3
+ <thead>
11
4
  <tr>
12
- <td class="key"><%= key %></td>
13
- <td class="number"><%== format_usec hash["usec"] %></td>
14
- <td class="number"><%= hash["calls"] %></td>
15
- <td class="number"><%== format_usec hash["usec_per_call"] %></td>
16
- <td class="number"><%== format_impact_percentage hash["impact"] %></td>
5
+ <th>Command</th>
6
+ <th class="is-right">Calls</th>
7
+ <th class="is-right">AVG time</th>
8
+ <th class="is-right">Total time</th>
9
+ <th class="is-right">Impact</th>
17
10
  </tr>
18
- <% end %>
11
+ </thead>
12
+ <tbody>
13
+ <% for (key,hash) in stats %>
14
+ <tr>
15
+ <td class="wrap"><%= key %></td>
16
+ <td class="is-right"><%= hash["calls"] %></td>
17
+ <td class="is-right"><%== format_usec hash["usec_per_call"] %></td>
18
+ <td class="is-right"><%== format_usec hash["usec"] %></td>
19
+ <td class="is-right"><%== format_impact_percentage hash["impact"] %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
19
23
  </table>
20
24
  </div>
@@ -4,7 +4,7 @@ module RedisDashboard
4
4
  end
5
5
 
6
6
  def self.urls
7
- @urls ||= ["redis://localhost"]
7
+ @urls ||= [ENV["REDIS_URL"] ||"redis://localhost"]
8
8
  end
9
9
  end
10
10
 
@@ -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.2.0"
6
+ spec.version = "0.3.0"
7
7
  spec.authors = ["Alexis Bernard"]
8
8
  spec.email = ["alexis@bernard.io"]
9
9
  spec.summary = "Sinatra app to monitor Redis servers."
@@ -19,5 +19,4 @@ Gem::Specification.new do |spec|
19
19
  spec.add_runtime_dependency "sinatra"
20
20
  spec.add_runtime_dependency "erubi"
21
21
  spec.add_runtime_dependency "redis"
22
- spec.add_runtime_dependency "sassc"
23
22
  end
data/screenshot.jpg CHANGED
Binary file
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-23 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: sassc
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  description: Sinatra app to monitor Redis servers
70
56
  email:
71
57
  - alexis@bernard.io
@@ -74,6 +60,7 @@ extensions: []
74
60
  extra_rdoc_files: []
75
61
  files:
76
62
  - ".gitignore"
63
+ - CHANGELOG.md
77
64
  - Gemfile
78
65
  - Gemfile.lock
79
66
  - LICENSE.txt
@@ -82,22 +69,27 @@ files:
82
69
  - lib/redis_dashboard/application.rb
83
70
  - lib/redis_dashboard/client.rb
84
71
  - lib/redis_dashboard/command.rb
72
+ - lib/redis_dashboard/public/ariato.css
73
+ - lib/redis_dashboard/public/style.css
85
74
  - lib/redis_dashboard/views/application.scss
86
75
  - lib/redis_dashboard/views/clients.erb
87
76
  - lib/redis_dashboard/views/config.erb
88
77
  - lib/redis_dashboard/views/index.erb
89
78
  - lib/redis_dashboard/views/info.erb
79
+ - lib/redis_dashboard/views/key.erb
80
+ - lib/redis_dashboard/views/key/hash.erb
81
+ - lib/redis_dashboard/views/key/list.erb
82
+ - lib/redis_dashboard/views/key/metadata.erb
83
+ - lib/redis_dashboard/views/key/set.erb
84
+ - lib/redis_dashboard/views/key/string.erb
85
+ - lib/redis_dashboard/views/key/unsupported.erb
86
+ - lib/redis_dashboard/views/key/zset.erb
87
+ - lib/redis_dashboard/views/keys.erb
88
+ - lib/redis_dashboard/views/keyspace.erb
90
89
  - lib/redis_dashboard/views/layout.erb
91
90
  - lib/redis_dashboard/views/memory.erb
92
91
  - lib/redis_dashboard/views/slowlog.erb
93
92
  - lib/redis_dashboard/views/stats.erb
94
- - lib/redis_dashboard/views/stylesheets/base.scss
95
- - lib/redis_dashboard/views/stylesheets/colors.scss
96
- - lib/redis_dashboard/views/stylesheets/link.scss
97
- - lib/redis_dashboard/views/stylesheets/page.scss
98
- - lib/redis_dashboard/views/stylesheets/server-card.scss
99
- - lib/redis_dashboard/views/stylesheets/table.scss
100
- - lib/redis_dashboard/views/stylesheets/typography.scss
101
93
  - redis_dashboard.gemspec
102
94
  - screenshot.jpg
103
95
  - start.rb
@@ -120,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
112
  - !ruby/object:Gem::Version
121
113
  version: '0'
122
114
  requirements: []
123
- rubygems_version: 3.0.3
115
+ rubygems_version: 3.1.6
124
116
  signing_key:
125
117
  specification_version: 4
126
118
  summary: Sinatra app to monitor Redis servers.
@@ -1,17 +0,0 @@
1
- html,
2
- body {
3
- box-sizing: border-box;
4
- font-size: 15px;
5
- overflow-x: hidden;
6
- width: 100%;
7
- }
8
- body {
9
- background: $color-lighter;
10
- color: $color-dark;
11
- font-family: 'Menlo', monospace;
12
- font-weight: 400;
13
- letter-spacing: 0;
14
- line-height: 24px;
15
- padding:0;
16
- margin:0;
17
- }
@@ -1,6 +0,0 @@
1
- $color-redis: #d82c20;
2
- $color-redis-dark: #a41e11;
3
- $color-dark: #574f4e;
4
- $color-light: #f2f1f0;
5
- $color-lighter: #f7f6f6;
6
- $color-white: #fff;
@@ -1,20 +0,0 @@
1
- a {
2
- color: $color-redis;
3
- text-decoration: none;
4
- }
5
- a:focus,
6
- a:hover {
7
- color: $color-redis-dark;
8
- }
9
-
10
- a svg {
11
- width:15px;
12
- height:15px;
13
- fill: $color-redis;
14
- position:
15
- relative;
16
- top: 3px;
17
- }
18
- a:hover svg {
19
- fill: $color-redis-dark;
20
- }
@@ -1,69 +0,0 @@
1
- .page {
2
- margin: 0px auto;
3
- overflow-x: hidden;
4
- max-width: 1480px;
5
- padding: 0 24px;
6
- }
7
-
8
- .page-header {
9
- display: flex;
10
- flex-wrap: wrap;
11
- }
12
- .page-header a {
13
- font-family: sans-serif;
14
- font-size: .694rem;
15
- font-weight: 400;
16
- text-transform: uppercase;
17
- letter-spacing: 2px;
18
- padding: 0 12px;
19
- background: $color-redis;
20
- color: $color-white;
21
- border-bottom: 1px solid $color-light;
22
- }
23
- .page-header a:hover {
24
- background: $color-redis-dark;
25
- }
26
- .page-header a.active {
27
- color: $color-redis;
28
- background: $color-white;
29
- font-weight: 700;
30
- }
31
-
32
- .page-title {
33
- font-size: 1rem;
34
- font-weight: 400;
35
- margin: 0 auto 24px 0;
36
- line-height: 48px;
37
- padding: 0;
38
- display: flex;
39
- flex-wrap: wrap;
40
- margin-right: auto;
41
- box-shadow: 0 4px 12px 0px $color-light;
42
- }
43
- .page-title span {
44
- display: inline-block;
45
- background-color: $color-white;
46
- padding: 0 12px;
47
- border-bottom: 1px solid $color-light;
48
- }
49
-
50
- .page-menu {
51
- display: flex;
52
- flex-wrap: nowrap;
53
- line-height: 48px;
54
- margin-bottom: 24px;
55
- box-shadow: 0 4px 12px 0px $color-light;
56
- }
57
-
58
- div.table {
59
- width: 100%;
60
- background: $color-white;
61
- overflow-x: scroll;
62
- margin-bottom: 24px;
63
- box-shadow: 0 4px 12px 0px $color-light;
64
- }
65
-
66
- .page-footer {
67
- margin-top: 24px;
68
- font-size: .833rem;
69
- }
@@ -1,37 +0,0 @@
1
- .server-list {
2
- display: flex;
3
- flex-wrap: wrap;
4
- margin: -24px 0 0 -24px;
5
- }
6
- .server-card {
7
- background: $color-white;
8
- padding: 0;
9
- flex: 1 1 480px;
10
- margin: 24px 0 0 24px;
11
- box-shadow: 0 4px 12px 0px $color-light;
12
- }
13
- .server-card-title {
14
- font-size: 1.2rem;
15
- margin-right: auto;
16
- padding: 24px;
17
- }
18
- .server-card-title a {
19
- text-decoration: underline;
20
- }
21
- .server-card-content {
22
- display: flex;
23
- flex-wrap: nowrap;
24
- }
25
- .server-card-content > div {
26
- margin:0;
27
- padding: 0 24px 24px;
28
- flex: 1;
29
- }
30
- .server-card-content .label {
31
- font-family: sans-serif;
32
- text-transform: uppercase;
33
- font-size: .574rem;
34
- letter-spacing: 2px;
35
- font-weight: 400;
36
- display: block;
37
- }
@@ -1,49 +0,0 @@
1
-
2
- // Table
3
- // ––––––––––––––––––––––––––––––––––––––––––––––––––
4
-
5
- table {
6
- border-spacing: 0;
7
- width: 100%;
8
- overflow-x: scroll;
9
- }
10
-
11
- tr:hover {
12
- background: $color-light;
13
- }
14
- thead tr:hover {
15
- background: $color-white;
16
- }
17
-
18
- td,
19
- th {
20
- border-bottom: 1px solid $color-light;
21
- padding: 12px 12px 11px;
22
- line-height: 24px;
23
- }
24
-
25
- th {
26
- font-weight: 400;
27
- font-family: sans-serif;
28
- font-size: .694rem;
29
- letter-spacing: 2px;
30
- text-transform: uppercase;
31
- text-align: center;
32
- }
33
-
34
- td.key {
35
- text-transform: uppercase;
36
- font-family: sans-serif;
37
- font-weight: 400;
38
- font-size: .694rem;
39
- letter-spacing: 2px;
40
- }
41
-
42
- td.date {
43
- white-space: nowrap;
44
- text-align: right;
45
- }
46
-
47
- td.number {
48
- text-align: right;
49
- }
@@ -1,21 +0,0 @@
1
- b,
2
- strong {
3
- font-weight: bold;
4
- }
5
-
6
- p {
7
- margin-top: 0;
8
- }
9
-
10
- h1,
11
- h2 {
12
- font-weight: 300;
13
- letter-spacing: 0;
14
- margin-bottom: 2.0rem;
15
- margin-top: 0;
16
- }
17
- h2 {
18
- font-size: 1.728rem;
19
- font-weight: 700;
20
- line-height: 2;
21
- }