lib/flapjack/gateways/web/views/self_stats.html.erb in flapjack-0.7.28 vs lib/flapjack/gateways/web/views/self_stats.html.erb in flapjack-0.7.29

- old
+ new

@@ -13,85 +13,94 @@ <div class="page-header"> <%= nav %> <h2>Internal Statistics</h2> </div> - <table class="table table-bordered table-hover table-condensed"> - <tr> - <td>Events queued:</td> - <td><%= h @events_queued %></td> - </tr> - <tr> - <td>Number of entities:</td> - <td><%= h @count_all_entities %></td> - </tr> - <tr> - <td>Number of failing entities:</td> - <td><%= h @count_failing_entities %></td> - </tr> - <tr> - <td>Number of checks:</td> - <td><%= h @count_all_checks %></td> - </tr> - <tr> - <td>Number of failing checks:</td> - <td><%= h @count_failing_checks %></td> - </tr> - <tr> - <td>Events processed (all time)</td> - <td><%= h @event_counters['all'] %> (ok: <%= h @event_counters['ok'] %>, failure: <%= h @event_counters['failure'] %>, action: <%= h @event_counters['action'] %>)</td> - </tr> - <tr> - <td>Events processed (this instance)</td> - <td><%= h @event_counters_instance['all'] %> (ok: <%= h @event_counters_instance['ok'] %>, failure: <%= h @event_counters_instance['failure'] %>, action: <%= h @event_counters_instance['action'] %>)</td> - </tr> - <tr> - <td>Average rate (this instance)</td> - <td><%= h @event_rate_all %></td> events per second - </tr> - <tr> - <td>Total keys in redis</td> - <td><%= h @dbsize %></td> - </tr> - <tr> - <td>Uptime</td> - <td><%= h @uptime_string %></td> - </tr> - <tr> - <td>Boot Time</td> - <td><%= h @boot_time %></td> - </tr> - <tr> - <td>Current time</td> - <td><%= h Time.now.to_s %></td> - </tr> - </table> + <div class="row"> + <div class="span5"> + <h4>Global Statistics:</h4> + <table class="table table-bordered table-hover table-condensed"> + <tr> + <td>Events queued:</td> + <td><%= h @events_queued %></td> + </tr> + <tr> + <td>Number of entities:</td> + <td><%= h @count_all_entities %></td> + </tr> + <tr> + <td>Number of failing entities:</td> + <td><%= h @count_failing_entities %></td> + </tr> + <tr> + <td>Number of checks:</td> + <td><%= h @count_all_checks %></td> + </tr> + <tr> + <td>Number of failing checks:</td> + <td><%= h @count_failing_checks %></td> + </tr> + <tr> + <td>Events processed (all time)</td> + <td> + <ul> + <li>all: <%= h @event_counters['all'] %> events</li> + <li>ok: <%= h @event_counters['ok'] %> events</li> + <li>failure: <%= h @event_counters['failure'] %> events</li> + <li>action: <%= h @event_counters['action'] %> events</li> + </ul> + </td> + </tr> + <tr> + <td>Total keys in redis</td> + <td><%= h @dbsize %></td> + </tr> + <tr> + <td>Current time</td> + <td><%= h Time.now.to_s %></td> + </tr> + </table> + </div> + <div class="span7"> + <h4>Processor Instances:</h4> + <table class="table table-bordered table-hover"> + <tr> + <th>Hostname</th> + <th>PID</th> + <th>Uptime</th> + <th>Events Processed</th> + </tr> + <% @executive_instances.sort_by {|i, d| d['uptime']}.each do |ei| %> + <% + instance_id, details = ei + hostname, pid = instance_id.split(':') + started = details['uptime_string'] + event_counters = details['event_counters'] + event_rates = details['event_rates'] + %> + <tr> + <td><%= h hostname %></td> + <td><%= h pid %></td> + <td><%= h started %></td> + <td> + <ul> + <li>all: <%= h event_counters['all'] %> (<%= h event_rates['all'] %> events/s)</li> + <li>ok: <%= h event_counters['ok'] %> (<%= h event_rates['ok'] %> events/s)</li> + <li>failure: <%= h event_counters['failure'] %> (<%= h event_rates['failure'] %> events/s)</li> + <li>action: <%= h event_counters['action'] %> (<%= h event_rates['action'] %> events/s)</li> + </ul> + </td> + </tr> + <% end %> + </table> + </div> + </div> - <h4>Executive Instances:</h4> - <table class="table table-bordered table-hover"> - <tr> - <th>Hostname</th> - <th>PID</th> - <th>Started</th> - </tr> - <% @executive_instances.each do |i| %> - <% - hostname, pid = i[0].split(':') - started = "#{relative_time_ago(Time.at(i[1].to_i))} ago" - %> - <tr> - <td><%= h hostname %></td> - <td><%= h pid %></td> - <td><%= h started %></td> - </tr> - <% end %> - </table> - <p><a href="/self_stats.json">Instrument as JSON</a></p> </div> <div id="push"></div> </div> <div id="footer"> <%= foot %> </div> </body> -</html> \ No newline at end of file +</html>