redis_dashboard 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 578baab7856107a9e28a00022dbc4bdc75a5f860
4
- data.tar.gz: 7335f0c7de979ac2e09a7a4fb06a34bce6ee90a2
3
+ metadata.gz: b7368d883f06fd1e645b36e38eda3265344e4e79
4
+ data.tar.gz: fd50890c3609ce804ff203eea14a0ebc85455572
5
5
  SHA512:
6
- metadata.gz: fd7ee9d82db93a2cc17f9bc3f1992023524f01a8e088e97a520298f271896fd1a9044a7505bb887c08a146318d538dc1fac4f7d5abf352ed131ae7316d9f5d56
7
- data.tar.gz: cbec9b324109fdd0b5e76618d1533093e55f7a61131b2c6ca2b76e804b7c89d11061cfaf6d347f27944aa9a683f233c081891956a48d277c0b90c46faa684019
6
+ metadata.gz: 35aaf7042c058433465f2aa74615bec63c44d08e66906da4fef874522dd106bddea978ec68f24c779f15b88b6825667777b0d33ff058f81008e42f8d187a7415
7
+ data.tar.gz: f6a728c21d83ca3f6cb31fde65b49ae0da1371a2a0db0c1416e0db8522f77d66be6feecb769aaedcf022b364c300ec002eff992fd95a0b4b9be7c588bc94f1cf
data/Gemfile.lock CHANGED
@@ -1,16 +1,26 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- rack (1.6.6)
5
- rack-protection (1.5.3)
4
+ ffi (1.11.1)
5
+ mustermann (1.0.3)
6
+ rack (2.0.7)
7
+ rack-protection (2.0.5)
6
8
  rack
7
- redis (3.3.3)
8
- sass (3.4.23)
9
- sinatra (1.4.8)
10
- rack (~> 1.5)
11
- rack-protection (~> 1.4)
12
- tilt (>= 1.3, < 3)
13
- tilt (2.0.7)
9
+ rb-fsevent (0.10.3)
10
+ rb-inotify (0.10.0)
11
+ ffi (~> 1.0)
12
+ redis (4.1.2)
13
+ sass (3.7.4)
14
+ sass-listen (~> 4.0.0)
15
+ sass-listen (4.0.0)
16
+ rb-fsevent (~> 0.9, >= 0.9.4)
17
+ rb-inotify (~> 0.9, >= 0.9.7)
18
+ sinatra (2.0.5)
19
+ mustermann (~> 1.0)
20
+ rack (~> 2.0)
21
+ rack-protection (= 2.0.5)
22
+ tilt (~> 2.0)
23
+ tilt (2.0.9)
14
24
 
15
25
  PLATFORMS
16
26
  ruby
@@ -26,7 +26,7 @@ class RedisDashboard::Application < Sinatra::Base
26
26
  end
27
27
 
28
28
  get "/slowlog" do
29
- erb(:slowlog, locals: {commands: client.slow_commands})
29
+ erb(:slowlog, locals: {client: client, commands: client.slow_commands})
30
30
  end
31
31
 
32
32
  get "/application.css" do
@@ -6,13 +6,7 @@ class RedisDashboard::Client
6
6
  end
7
7
 
8
8
  def clients
9
- connection.client.call([:client, "list"]).split("\n").map do |line|
10
- line.split(" ").reduce({}) do |hash, str|
11
- pair = str.split("=")
12
- hash[pair[0]] = pair[1]
13
- hash
14
- end
15
- end
9
+ connection.client("list")
16
10
  end
17
11
 
18
12
  def config
@@ -35,8 +29,8 @@ class RedisDashboard::Client
35
29
  stats
36
30
  end
37
31
 
38
- def slow_commands(length = 128) # 128 is the default slowlog-max-len
39
- connection.slowlog("get", length).map do |entry|
32
+ def slow_commands
33
+ connection.slowlog("get", config["slowlog-max-len"]).map do |entry|
40
34
  cmd = RedisDashboard::Command.new
41
35
  cmd.id = entry[0]
42
36
  cmd.timestamp = entry[1]
@@ -1,3 +1,8 @@
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
+
1
6
  <div class="table">
2
7
  <table>
3
8
  <thead>
@@ -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.3"
6
+ spec.version = "0.1.4"
7
7
  spec.authors = ["Alexis Bernard"]
8
8
  spec.email = ["alexis@bernard.io"]
9
9
  spec.summary = "Sinatra app to monitor Redis servers."
@@ -17,4 +17,6 @@ Gem::Specification.new do |spec|
17
17
  spec.require_paths = ["lib"]
18
18
 
19
19
  spec.add_runtime_dependency "sinatra"
20
+ spec.add_runtime_dependency "redis"
21
+ spec.add_runtime_dependency "sass"
20
22
  end
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-05 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: redis
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sass
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
27
55
  description: Sinatra app to monitor Redis servers
28
56
  email:
29
57
  - alexis@bernard.io