Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 19 files changed
  • 0 comments
  • 2 contributors
7 CHANGELOG.md
Source Rendered
... ... @@ -1,6 +1,11 @@
  1 +* 0.5 - 2011-07-28
  2 + * Added Cluster Properties to dashboard (from Penumbra)
  3 + * Added Infinispan cache links to dashboard (from Penumbra)
  4 + * Added Caches tab view (from Penumbra)
  5 +
1 6 * 0.4.3 - 2011-07-14
2 7 * Updated to use TorqueBox 1.1 gems
3   -
  8 +
4 9 * 0.4.2 - 2011-06-20
5 10 * Locked gemspec gem versions to match Gemfile.lock versions (issue #5)
6 11 * Restored Rakefile to repo
1  TORQUEBOX_VERSION
... ... @@ -1 +1,2 @@
1 1 1.1
  2 +
3  VERSION
... ... @@ -1 +1,2 @@
1   -0.4.3
  1 +0.5
  2 +
3  backstage.rb
@@ -36,7 +36,8 @@
36 36 require 'jobs'
37 37 require 'logs'
38 38 require 'services'
39   -
  39 +require 'caches'
  40 +require 'groups'
40 41
41 42 Backstage.logger.warn "ENV['REQUIRE_AUTHENTICATION'] is not set, *disabling* authentication" unless ENV['REQUIRE_AUTHENTICATION']
42 43
18 lib/caches.rb
... ... @@ -0,0 +1,18 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +require 'caches/models/cache'
  18 +require 'caches/routes'
70 lib/caches/models/cache.rb
... ... @@ -0,0 +1,70 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +module Backstage
  18 + class Cache
  19 + include HasMBean
  20 + include Resource
  21 +
  22 + def self.filter
  23 + "org.infinispan:component=CacheManager,*"
  24 + end
  25 +
  26 + def self.to_hash_attributes
  27 + super + [:name, :cache_manager_status, :created_cache_count, :defined_cache_count, :running_cache_count, :version, :defined_cache_names]
  28 + end
  29 +
  30 + # for use with show.haml
  31 + alias_method :cache_manager_name, :name
  32 +
  33 + # reformat the defined_cache_names string
  34 + def cache_names
  35 + names = {}
  36 + dcns = self.defined_cache_names.sub('[', '')
  37 +
  38 + list = dcns.split(')')
  39 + list.each do |cache_name|
  40 + unless cache_name == "]"
  41 + if cache_name.include? "(not created"
  42 + names.store(cache_name.sub("(not created", ""), "not created")
  43 + else
  44 + names.store(cache_name.sub("(created", ""), "created")
  45 + end
  46 + end
  47 + end
  48 +
  49 + names
  50 + end
  51 +
  52 + def rpc_caches
  53 + rpc = JMX::MBeanServer.new
  54 + manager = self.name
  55 + rpc_caches = [] # JMX::MBeans::Org::Infinispan::Remoting::Rpc::RpcManagerImpl
  56 +
  57 + # find the name of the cluster connection control
  58 + filter_str = 'org.infinispan:component=RpcManager,manager="' + manager + '",*'
  59 +
  60 + rpc.query_names( filter_str ).collect do |name|
  61 + data = name.to_s.split(',')
  62 + cache_name = data[1].sub('name=', '')
  63 +
  64 + rpc_caches << [ cache_name, JMX::MBeanServer.new[ name ] ]
  65 + end
  66 +
  67 + rpc_caches
  68 + end
  69 + end
  70 +end
17 lib/caches/routes.rb
... ... @@ -0,0 +1,17 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +Backstage::Application.resource :cache
19 lib/groups.rb
... ... @@ -0,0 +1,19 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +require 'groups/models/group'
  18 +require 'groups/routes'
  19 +
45 lib/groups/models/group.rb
... ... @@ -0,0 +1,45 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +module Backstage
  18 + class Group
  19 + include HasMBean
  20 + include Resource
  21 +
  22 + def self.filter
  23 + "jboss.jgroups:cluster=*,type=channel"
  24 + end
  25 +
  26 + def self.to_hash_attributes
  27 + super + [:name, :received_messages, :received_bytes, :connected, :num_messages, :receive_local_msgs, :view, :sent_bytes, :timer_threads, :cluster_name, :receive_blocks, :address, :number_of_tasks_in_timer, :stats, :version, :sent_messages]
  28 + end
  29 +
  30 + def protocols
  31 + mbean = JMX::MBeanServer.new
  32 + cluster = self.cluster_name
  33 + protocols = []
  34 +
  35 + # find the protocols used by 'cluster'
  36 + filter_str = 'jboss.jgroups:cluster=' + cluster + ',protocol=*,*'
  37 +
  38 + mbean.query_names( filter_str ).collect do |name|
  39 + protocols << JMX::MBeanServer.new[ name ]
  40 + end
  41 +
  42 + protocols
  43 + end
  44 + end
  45 +end
17 lib/groups/routes.rb
... ... @@ -0,0 +1,17 @@
  1 +#
  2 +# Copyright 2011 Red Hat, Inc.
  3 +#
  4 +# Licensed under the Apache License, Version 2.0 (the "License");
  5 +# you may not use this file except in compliance with the License.
  6 +# You may obtain a copy of the License at
  7 +#
  8 +# http://www.apache.org/licenses/LICENSE-2.0
  9 +#
  10 +# Unless required by applicable law or agreed to in writing, software
  11 +# distributed under the License is distributed on an "AS IS" BASIS,
  12 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +# See the License for the specific language governing permissions and
  14 +# limitations under the License.
  15 +#
  16 +
  17 +Backstage::Application.resource :group
45 lib/helpers.rb
@@ -66,6 +66,7 @@ def object_action_or_collection_path(*objects)
66 66 paths << collection_or_action if collection_or_action
67 67 '/' + paths.join( '/' )
68 68 end
  69 +
69 70 alias_method :object_action_path, :object_action_or_collection_path
70 71 alias_method :collection_path, :object_action_or_collection_path
71 72
@@ -216,6 +217,50 @@ def jboss_version_info
216 217 versions << ['Version', jboss.version]
217 218 versions
218 219 end
  220 +
  221 + def infinispan_version_info
  222 + versions = []
  223 + infinispan = JMX::MBeanServer.new
  224 + cm = nil # JMX::MBeans::Org::Infinispan::Manager::DefaultCacheManager
  225 +
  226 + infinispan.query_names( 'org.infinispan:component=CacheManager,name=*,type=CacheManager' ).collect {|name| cm = JMX::MBeanServer.new[ name ] }
  227 +
  228 + if cm
  229 + versions << ['Version', cm.version ]
  230 + else
  231 + versions << ['Version', 'disabled']
  232 + end
  233 + versions
  234 + end
  235 +
  236 + def hornetq_cluster_info
  237 + info = []
  238 + ccc = nil # JMX::MBeans::Org::Hornetq::Core::Management::Impl::ClusterConnectionControlImpl
  239 + hornetq = JMX::MBeanServer.new
  240 +
  241 + # find the name of the cluster connection control
  242 + hornetq.query_names( 'org.hornetq:module=Core,name=*,type=ClusterConnection,*' ).collect {|name| ccc = JMX::MBeanServer.new[ name ] }
  243 +
  244 + if ccc
  245 + ccc.attributes.each do |attr|
  246 + info << [ attr, ccc[attr] ] unless ((attr == "StaticConnectorNamePairs") || (attr == "StaticConnectorNamePairsAsJSON"))
  247 + end
  248 + end
  249 +
  250 + if info.size == 0
  251 + info << ['Cluster', 'disabled']
  252 + end
  253 + info
  254 + end
  255 +
  256 + #def jgroups_cluster_channels
  257 + # mux_channels = []
  258 + # jgroups = JMX::MBeanServer.new
  259 +
  260 + # find the name of the jgroups channels
  261 + # jgroups.query_names( 'jboss.jgroups:cluster=*,type=channel' ).collect {|name| mux_channels << JMX::MBeanServer.new[ name ] }
  262 + # mux_channels
  263 + #end
219 264 end
220 265 end
221 266 end
91 torquebox-backstage.gemspec
@@ -2,12 +2,11 @@
2 2
3 3 Gem::Specification.new do |s|
4 4 s.name = %q{torquebox-backstage}
5   - s.version = "0.4.3"
  5 + s.version = "0.5"
6 6
7 7 s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8   - s.authors = ["Tobias Crawley"]
9   - s.date = %q{2011-07-14}
10   - s.default_executable = %q{backstage}
  8 + s.authors = ["Tobias Crawley", "David Glassborow", "Penumbra Shadow"]
  9 + s.date = %q{2011-07-28}
11 10 s.description = %q{BackStage allows you to look behind the TorqueBox curtain, and view information about all of the components you have running. It includes support for remote code execution and log tailing to aid in debugging.}
12 11 s.email = %q{tcrawley@redhat.com}
13 12 s.executables = ["backstage"]
@@ -15,79 +14,19 @@ Gem::Specification.new do |s|
15 14 "README.md",
16 15 "TODO"
17 16 ]
18   - s.files = [
19   - "CHANGELOG.md",
20   - "Gemfile",
21   - "Gemfile.lock",
22   - "README.md",
23   - "TODO",
24   - "TORQUEBOX_VERSION",
25   - "VERSION",
26   - "backstage.rb",
27   - "config.ru",
28   - "config/torquebox.yml",
29   - "lib/apps.rb",
30   - "lib/apps/models/app.rb",
31   - "lib/apps/routes.rb",
32   - "lib/authentication.rb",
33   - "lib/destinations.rb",
34   - "lib/destinations/models/destination.rb",
35   - "lib/destinations/models/message.rb",
36   - "lib/destinations/models/queue.rb",
37   - "lib/destinations/models/topic.rb",
38   - "lib/destinations/routes.rb",
39   - "lib/has_mbean.rb",
40   - "lib/helpers.rb",
41   - "lib/jobs.rb",
42   - "lib/jobs/models/job.rb",
43   - "lib/jobs/routes.rb",
44   - "lib/logs.rb",
45   - "lib/logs/models/log.rb",
46   - "lib/logs/routes.rb",
47   - "lib/message_processors.rb",
48   - "lib/message_processors/models/message_processor.rb",
49   - "lib/message_processors/routes.rb",
50   - "lib/pools.rb",
51   - "lib/pools/models/pool.rb",
52   - "lib/pools/routes.rb",
53   - "lib/resource.rb",
54   - "lib/resource_helpers.rb",
55   - "lib/runtimes.rb",
56   - "lib/runtimes/models/job.rb",
57   - "lib/runtimes/routes.rb",
58   - "lib/services.rb",
59   - "lib/services/models/service.rb",
60   - "lib/services/routes.rb",
61   - "lib/torquebox_managed.rb",
62   - "lib/util.rb",
63   - "public/ajax-loader.gif",
64   - "public/app.js",
65   - "public/jquery.min.js",
66   - "views/apps/index.haml",
67   - "views/apps/show.haml",
68   - "views/css/_mixins.sass",
69   - "views/css/html5reset.sass",
70   - "views/css/style.sass",
71   - "views/dashboard/index.haml",
72   - "views/destinations/index.haml",
73   - "views/destinations/show.haml",
74   - "views/jobs/index.haml",
75   - "views/jobs/show.haml",
76   - "views/layout.haml",
77   - "views/logs/index.haml",
78   - "views/logs/show.haml",
79   - "views/message_processors/index.haml",
80   - "views/message_processors/show.haml",
81   - "views/messages/index.haml",
82   - "views/messages/properties.haml",
83   - "views/messages/show.haml",
84   - "views/pools/index.haml",
85   - "views/pools/show.haml",
86   - "views/services/index.haml",
87   - "views/services/show.haml"
88   - ]
  17 +
  18 + s.files = Dir[
  19 + "backstage.rb",
  20 + "config.ru",
  21 + "[A-Z]*",
  22 + "config/**/*",
  23 + "lib/**/*",
  24 + "public/**/*",
  25 + "views/**/*"
  26 + ]
  27 +
89 28 s.homepage = %q{http://github.com/torquebox/backstage}
90   - s.licenses = ["MIT"]
  29 + s.licenses = ["AL"]
91 30 s.require_paths = ["lib"]
92 31 s.rubygems_version = %q{1.5.1}
93 32 s.summary = %q{BackStage - Queue/Topic/Job/etc viewer for TorqueBox}
18 views/caches/index.haml
... ... @@ -0,0 +1,18 @@
  1 +#caches-index
  2 + %table
  3 + %tr
  4 + %th Name
  5 + %th Status
  6 + %th Created
  7 + %th Defined
  8 + %th Running
  9 + %th Version
  10 + %th
  11 + - @collection.each do |cache|
  12 + %tr
  13 + %td= link_to( object_path( cache ), cache.name )
  14 + %td= cache.cache_manager_status.downcase
  15 + %td= cache.created_cache_count
  16 + %td= cache.defined_cache_count
  17 + %td= cache.running_cache_count
  18 + %td= cache.version
18 views/caches/show.haml
... ... @@ -0,0 +1,18 @@
  1 +#caches-show
  2 + %h2
  3 + == Infinispan Cache: #{@object.name}
  4 +
  5 + %table.data-table
  6 + - %w{ cache_manager_name cache_manager_status created_cache_count defined_cache_count running_cache_count version cache_names }.each do |method|
  7 + = data_row( method.humanize, @object.send( method ) )
  8 +
  9 + - @object.rpc_caches.each do |cache_name, rpc_cache|
  10 + %h3== RPC Cache: #{cache_name}
  11 + .rpc-cache
  12 + %table.data-table
  13 + .element
  14 + - rpc_cache.attributes.each do |attr|
  15 + = data_row( attr, rpc_cache[ attr ] )
  16 +
  17 + .controls
  18 + = link_to collection_path( :caches ), '<< Back'
18 views/css/style.sass
@@ -149,6 +149,20 @@ th
149 149 position: absolute
150 150 top: 1px
151 151
  152 +#groups-show
  153 + h3
  154 + font-weight: bold
  155 + margin: 10px 0
  156 + .protocol
  157 + padding-left: 10px
  158 +
  159 +#caches-show
  160 + h3
  161 + font-weight: bold
  162 + margin: 10px 0
  163 + .rpc-cache
  164 + padding-left: 10px
  165 +
152 166 #dashboard
153 167 @include clearfix
154 168 #left_column, #right_column
@@ -195,4 +209,8 @@ th
195 209 @include selected-tab('service', 'services')
196 210 @include selected-tab('pools')
197 211 @include selected-tab('pool', 'pools')
  212 +@include selected-tab('caches')
  213 +@include selected-tab('cache', 'caches')
  214 +@include selected-tab('groups')
  215 +@include selected-tab('group', 'groups')
198 216
38 views/dashboard/index.haml
@@ -22,18 +22,48 @@
22 22 - jboss_version_info.each do |key, value|
23 23 - unless value.blank?
24 24 %li== #{key}: #{value}
25   - %li
  25 + %li
26 26 HornetQ:
27 27 %ul
28 28 - hornetq_version_info.each do |key, value|
29 29 - unless value.blank?
30 30 %li== #{key}: #{value}
  31 + %li
  32 + Infinispan:
  33 + %ul
  34 + - infinispan_version_info.each do |key, value|
  35 + - unless value.blank?
  36 + %li== #{key}: #{value}
31 37 /
32 38 %li
33   - Quartz:
  39 + Quartz:
34 40 %ul
35 41 %li== Version: ???
36 42
  43 + #cluster_properties.list
  44 + %h3 HornetQ Cluster
  45 + .element
  46 + %ul
  47 + - hornetq_cluster_info.each do |key, value|
  48 + %li== #{key}: #{value}
  49 +
  50 + #caches.list
  51 + %h3 Infinispan Caches
  52 + .actions
  53 + = link_to( collection_path( :caches ), 'View All Caches' )
  54 + - Backstage::Cache.all.each do |cache|
  55 + .element
  56 + = link_to object_path( cache ), "#{cache.name}"
  57 +
  58 + #groups.list
  59 + %h3 JGroups
  60 + .actions
  61 + = link_to( collection_path( :groups ), 'View All Groups' )
  62 + - Backstage::Group.all.each do |group|
  63 + .element
  64 + = link_to object_path( group ), "#{group.cluster_name}"
  65 +
  66 + #right_column
37 67 #apps.list
38 68 %h3 Apps
39 69 .actions
@@ -58,7 +88,6 @@
58 88 .element
59 89 = link_to object_path( topic ), "#{topic.display_name} - #{topic.app_name}"
60 90
61   - #right_column
62 91 #message_processors.list
63 92 %h3 Message Processors
64 93 .actions
@@ -91,6 +120,3 @@
91 120 .element
92 121 = link_to object_path( pool ), "#{pool.name} - #{pool.app_name}"
93 122
94   -
95   -
96   -
24 views/groups/index.haml
... ... @@ -0,0 +1,24 @@
  1 +#groups-index
  2 + %table
  3 + %tr
  4 + %th ClusterName
  5 + %th ReceivedMessages
  6 + %th ReceivedBytes
  7 + %th Open
  8 + %th Connected
  9 + %th Address
  10 + %th NumMessages
  11 + %th ReceiveLocalMsgs
  12 + %th View
  13 + %th
  14 + - @collection.each do |group|
  15 + %tr
  16 + %td= link_to( object_path( group ), group.cluster_name )
  17 + %td= group.received_messages
  18 + %td= group.received_bytes
  19 + %td= group.open
  20 + %td= group.connected
  21 + %td= group.address
  22 + %td= group.num_messages
  23 + %td= group.receive_local_msgs
  24 + %td= group.view
17 views/groups/show.haml
... ... @@ -0,0 +1,17 @@
  1 +#groups-show
  2 + %h2
  3 + == JGroups: #{@object.cluster_name}
  4 +
  5 + %table.data-table
  6 + - %w{ name received_messages received_bytes connected num_messages receive_local_msgs view address sent_bytes sent_messages timer_threads receive_blocks number_of_tasks_in_timer stats version }.each do |method|
  7 + = data_row( method.humanize, @object.send( method ) )
  8 +
  9 + - @object.protocols.each do |protocol|
  10 + %h3== Protocol: #{protocol.name}
  11 + .protocol
  12 + %table.data-table
  13 + - protocol.attributes.each do |attr|
  14 + = data_row( attr, protocol[attr] )
  15 +
  16 + .controls
  17 + = link_to collection_path( :groups ), '<< Back'
3  views/layout.haml
@@ -17,7 +17,8 @@
17 17 = link_to collection_path( :jobs ), 'Jobs', :class => 'jobs'
18 18 = link_to collection_path( :services ), 'Services', :class => 'services'
19 19 = link_to collection_path( :pools ), 'Runtime Pools', :class => 'pools'
20   -
  20 + = link_to collection_path( :caches ), 'Caches', :class => 'caches'
  21 + = link_to collection_path( :groups ), 'JGroups', :class => 'groups'
21 22 #content-wrapper
22 23 - if flash_msg = flash[:notice]
23 24 #flash

No commit comments for this range

Something went wrong with that request. Please try again.