Sha256: 894406f55a128794eebfbdf4cee2ab41dfd157615f76c778ad87eab84c4da6f7
Contents?: true
Size: 1 KB
Versions: 1
Compression:
Stored size: 1 KB
Contents
module ActiveAdminSidekiqStats class Panel def self.inject klass = new klass.inject! end def inject! html = Arbre::Context.new do panel "Sidekiq Stats" do begin sidekiq = JSON.parse(::Sidekiq::Stats.new.to_json) stats = sidekiq.fetch("stats", Hash.new) div style: "display: flex; justify-content: center; align-items: center" do stats.each do |process_name, process_value| div style: "display: flex; flex:1; justify-content: center; align-items: center; flex-direction: column" do h1 process_value span process_name end end end rescue Redis::CannotConnectError h1 "Redis Connection Failed" end end end html.to_s end private def container_style "display: flex; justify-content: center; align-items: center" end def item_style "flex:1; justify-content: center;" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activeadmin_sidekiq_stats-0.1.0 | lib/activeadmin_sidekiq_stats/panel.rb |