lib/flapjack/gateways/web/views/self_stats.html.erb in flapjack-1.6.0 vs lib/flapjack/gateways/web/views/self_stats.html.erb in flapjack-2.0.0b1

- old
+ new

@@ -36,53 +36,53 @@ <div class="col-md-6"> <h4>Global Statistics:</h4> <table class="table table-bordered table-hover table-condensed"> <tr> <td>Events queued:</td> - <td><%= h @events_queued %></td> + <td><%= h @metrics[:event_queue_length] %></td> </tr> <tr> - <td>Number of enabled entities:</td> - <td><%= h @count_current_entities %></td> - </tr> - <tr> - <td>Number of failing entities:</td> - <td><%= h @count_failing_entities %></td> - </tr> - <tr> <td>Number of enabled checks:</td> - <td><%= h @count_current_checks %></td> + <td><%= h @metrics[:check_counts][:enabled] %></td> </tr> <tr> <td>Number of failing checks:</td> - <td><%= h @count_failing_checks %></td> + <td><%= h @metrics[:check_counts][:failing] %></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> - <li>invalid: <%= h @event_counters['invalid'] %> events</li> - </ul> - </td> + <td>Number of disabled checks:</td> + <td><%= h @metrics[:check_counts][:all] - @metrics[:check_counts][:enabled] %></td> </tr> <tr> + <% if @global_stats.nil? %> + <td colspan="2">No statistics found.</td> + <% else %> + <td>Events processed (all time)</td> + <td> + <ul> + <li>all: <%= h @global_stats[:all_events] %> events</li> + <li>ok: <%= h @global_stats[:ok_events] %> events</li> + <li>failure: <%= h @global_stats[:failure_events] %> events</li> + <li>action: <%= h @global_stats[:action_events] %> events</li> + <li>invalid: <%= h @global_stats[:invalid_events] %> events</li> + </ul> + </td> + <% end %> + </tr> + <tr> <td>Check Freshness</td> <td> <ul> - <% @current_checks_ages.each_pair do |age, check_count| %> + <% @metrics[:check_freshness].each_pair do |age, check_count| %> <li>&gt;= <%= h age %>: <%= h check_count %></li> <% end %> </ul> </td> </tr> <tr> <td>Total keys in redis</td> - <td><%= h @dbsize %></td> + <td><%= h @metrics[:total_keys] %></td> </tr> <tr> <td>Current time</td> <td><%= h Time.now.to_s %></td> </tr> @@ -95,37 +95,36 @@ <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| %> + <% @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'] + started = details[:uptime_string] + 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> - <li>invalid: <%= h event_counters['invalid'] %> (<%= h event_rates['invalid'] %> events/s)</li> + <li>all: <%= h details[:all_events] %> (<%= h event_rates[:all_events] %> events/s)</li> + <li>ok: <%= h details[:ok_events] %> (<%= h event_rates[:ok_events] %> events/s)</li> + <li>failure: <%= h details[:failure_events] %> (<%= h event_rates[:failure_events] %> events/s)</li> + <li>action: <%= h details[:action_events] %> (<%= h event_rates[:action_events] %> events/s)</li> + <li>invalid: <%= h details[:invalid_events] %> (<%= h event_rates[:invalid_events] %> events/s)</li> </ul> </td> </tr> <% end %> </table> </div> </div> <p> - <a class="btn btn-success" href="<% @base_url %>self_stats.json">View as JSON</a> + <a class="btn btn-success" href="<%= @base_url %>self_stats.json">View as JSON</a> Learn how to <a href="http://flapjack.io/docs/1.0/development/Gathering-internal-statistics-with-collectd"> use these metrics</a>. </p>