Permalink
Browse files

Added a test to prevent errors on Watches that don't monitor a CPU ti…

…me or Memory usage
  • Loading branch information...
1 parent 83c7d3b commit ea328577b52a03091a2216ddeb0a7597e88d74df Mathieu Ravaux committed Aug 20, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 views/prophet/index.html.haml
@@ -11,8 +11,8 @@
%tr{:id => svc, :class => 'service'}
%td= svc
%td= @watches[svc].group.nil? ? "--" : @watches[svc].group
- %td= "%.2f%%" % @watches[svc].cpu_usage
- %td= @watches[svc].memory_usage.to_s + "kb"
+ %td= (@watches[svc].respond_to? "cpu_usage")? ("%.2f%%" % @watches[svc].cpu_usage) : "N/A"
+ %td= (@watches[svc].respond_to? "memory_usage")? (@watches[svc].memory_usage.to_s + "kb") : "N/A"
%td= @watches[svc].state
%div{:id => "controls", :class => "jqmWindow", :style => "display: none;"}

0 comments on commit ea32857

Please sign in to comment.