You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/02/09 03:29:14 UTC

svn commit: r1444315 - in /activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console: index.html js/app.js

Author: chirino
Date: Sat Feb  9 02:29:13 2013
New Revision: 1444315

URL: http://svn.apache.org/r1444315
Log:
Display the store status.

Modified:
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html?rev=1444315&r1=1444314&r2=1444315&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html Sat Feb  9 02:29:13 2013
@@ -132,12 +132,74 @@
                   {{/each}}
                   </ul>
                 </td></tr>
-                {{#if App.virtual_host.store}}
-                <tr><td><strong>Store: </strong>{{App.virtual_host_store.id}}</td></tr>
-                {{/if}}
                 </tbody>
               </table>
             </div>
+            {{#if App.virtual_host.store}}
+            <div class="well" style="padding: 8px 8px">
+              {{#if App.VirtualHostController.store_is_leveldb}}
+              <div class="well-title">LevelDB Store Status</div>
+              <table class="details table table-bordered table-striped">
+                <tbody>
+                <tr><td><strong>Location: </strong>{{App.virtual_host_store.id}}</td></tr>
+                <tr><td><strong>Disk Usage: </strong>{{App.virtual_host_store.disk_usage}}</td></tr>
+                <tr><td><strong>Messages Stored:</strong>
+                  <table class="details table table-bordered table-striped">
+                    <tbody>
+                      <tr><td><strong>Pending: </strong>{{App.virtual_host_store.pending_stores}}</td></tr>
+                      <tr><td><strong>Canceled: </strong>{{App.virtual_host_store.canceled_message_counter}}</td></tr>
+                      <tr><td><strong>Flushed: </strong>{{App.virtual_host_store.flushed_message_counter}}</td></tr>
+                    </tbody>
+                  </table>
+                </td></tr>
+                <tr><td><strong>Enqueues Stored:</strong>
+                  <table class="details table table-bordered table-striped">
+                    <tbody>
+                      <tr><td><strong>Canceled: </strong>{{App.virtual_host_store.canceled_enqueue_counter}}</td></tr>
+                      <tr><td><strong>Flushed: </strong>{{App.virtual_host_store.flushed_enqueue_counter}}</td></tr>
+                    </tbody>
+                  </table>
+                </td></tr>
+                <tr><td><strong>Index snapshot at: </strong>{{hex App.virtual_host_store.index_snapshot_pos}}</td></tr>
+                <tr><td><strong>Log append position: </strong>{{hex App.virtual_host_store.log_append_pos}}</td></tr>
+                <tr><td style="max-width:100px"><strong>Log Details: </strong>
+                    <pre style="color:#333; font-size:80%; overflow:auto; word-wrap: normal; white-space:pre;">{{App.virtual_host_store.log_stats}}</pre>
+                </td></tr>
+                <tr><td style="max-width:100px"><strong>Index Details: </strong>
+                  <pre style="color:#333; font-size:80%; overflow:auto; word-wrap: normal; white-space:pre;">{{App.virtual_host_store.index_stats}}</pre>
+                </td></tr>
+                <tr><td><strong>Message Load Latency: </strong>
+                  <table class="details table table-bordered table-striped">
+                    <tbody>
+                      <tr><td><strong>Count: </strong>{{App.virtual_host_store.message_load_latency.count}}</td></tr>
+                      <tr><td><strong>Total: </strong>{{App.virtual_host_store.message_load_latency.total}} ms</td></tr>
+                      <tr><td><strong>Max: </strong>{{App.virtual_host_store.message_load_latency.max}} ms</td></tr>
+                      <tr><td><strong>Min: </strong>{{App.virtual_host_store.message_load_latency.min}} ms</td></tr>
+                    </tbody>
+                  </table>
+                </td></tr>
+                <tr><td><strong>Message Flush Latency: </strong>
+                  <table class="details table table-bordered table-striped">
+                    <tbody>
+                      <tr><td><strong>Count: </strong>{{App.virtual_host_store.flush_latency.count}}</td></tr>
+                      <tr><td><strong>Total: </strong>{{App.virtual_host_store.flush_latency.total}} ms</td></tr>
+                      <tr><td><strong>Max: </strong>{{App.virtual_host_store.flush_latency.max}} ms</td></tr>
+                      <tr><td><strong>Min: </strong>{{App.virtual_host_store.flush_latency.min}} ms</td></tr>
+                    </tbody>
+                  </table>
+                </td></tr>
+                </tbody>
+              </table>
+              {{else}}
+              <div class="well-title">Store</div>
+              <table class="details table table-bordered table-striped">
+                <tbody>
+                <tr><td><strong>Name: </strong>{{App.virtual_host_store.id}}</td></tr>
+                </tbody>
+              </table>
+              {{/if}}
+            </div>
+            {{/if}}
           </div>
           <div class="span8">
             {{view Bootstrap.Tabs contentBinding="App.VirtualHostController.tabs" selectionBinding="App.VirtualHostController.selected_tab"}}

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js?rev=1444315&r1=1444314&r2=1444315&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js Sat Feb  9 02:29:13 2013
@@ -399,11 +399,17 @@ App.VirtualHostController = Em.ArrayCont
     }
 
   },
+
   onSelectedChange: function() {
     App.set("destination", null)
     App.MessagesController.clear();
     this.refresh();
-  }.observes("selected")
+  }.observes("selected"),
+
+  store_is_leveldb: function(){
+   var clazz = App.get("virtual_host_store.@class")
+   return clazz == "leveldb_store_status";
+  }.property("App.virtual_host_store.@class"),
 });
 
 App.DestinationsController = App.PagedArrayController.create({
@@ -1098,6 +1104,15 @@ Ember.Handlebars.registerHelper('memory'
   }
   return Ember.Handlebars.helpers.bind(property, options);
 });
+Ember.Handlebars.registerHelper('hex', function(property, options) {
+  options.fn = function(size) {
+    if( (typeof size)=="number" ) {
+      return "0x"+size.toString(16);
+    }
+    return size;
+  }
+  return Ember.Handlebars.helpers.bind(property, options);
+});
 
 $(window).resize(function() {
  App.set("window_size", {