active_admin-sidekiq_stats 0.0.1
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 +7 -0
- data/lib/active_admin-sidekiq_stats.rb +1 -0
- data/lib/active_admin/sidekiq_stats.rb +37 -0
- metadata +72 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 480bc037f6248615999673e0323e3277ef8615455917b49203380efdc411b136
|
4
|
+
data.tar.gz: 963aa87bb09e0d26b4489ea470704a32882cecec7b0b3148c3e1f4b7bb5f0b69
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 49db313ff2fc546ee503a13d729e91ac0c380e0d48b9f0cff537fa0b8b9e02b7b165137f0f5efc9cab6ecb9ba256588c91831c93716338d1a8897c617986d538
|
7
|
+
data.tar.gz: 717dd426f14db1c8e4a46cdb6b9146b0c11b87b1f23bfa43b83ee5d1d101ada3dc754aaca88270bc653b887df015f11f38134996153e2bc2046e13e6c273e234
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'active_admin/sidekiq-stats'
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
class SidekiqStats < Arbre::Component
|
3
|
+
builder_method :active_admin_sidekiq_stats
|
4
|
+
|
5
|
+
CONTAINER_STYLE = 'display: flex; justify-content: center; align-items: center;'
|
6
|
+
VALUE_STYLE = 'display: flex; flex:1; justify-content: center; align-items: center; flex-direction: column; align-self: baseline; text-align: center;'
|
7
|
+
|
8
|
+
def build(attributes = {})
|
9
|
+
super(attributes)
|
10
|
+
|
11
|
+
panel('Sidekiq Stats') do
|
12
|
+
div(style: CONTAINER_STYLE) do
|
13
|
+
begin
|
14
|
+
build_fields
|
15
|
+
rescue Redis::CannotConnectError
|
16
|
+
h1 'Redis Connection Failed'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def build_fields
|
25
|
+
JSON.parse(Sidekiq::Stats.new.to_json).fetch('stats', Hash.new).yield_self do |stats|
|
26
|
+
stats.each do |name, value|
|
27
|
+
div style: VALUE_STYLE do
|
28
|
+
h1 value.round
|
29
|
+
span name.titleize
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
rescue => e
|
34
|
+
div { h3 e.message }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: active_admin-sidekiq_stats
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Datarade
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: arbre
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sidekiq
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 5.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 5.0.0
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- lib/active_admin-sidekiq_stats.rb
|
48
|
+
- lib/active_admin/sidekiq_stats.rb
|
49
|
+
homepage:
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
metadata: {}
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
requirements: []
|
68
|
+
rubygems_version: 3.0.4
|
69
|
+
signing_key:
|
70
|
+
specification_version: 4
|
71
|
+
summary: Active Admin component to display Sidekiq statistics.
|
72
|
+
test_files: []
|