<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -17,7 +17,7 @@ class Watch &lt; ActiveRecord::Base
     # puts interval
     average = Response.average(:time, :conditions =&gt; ['watch_id = ? and time != 0 and created_at &lt; ? and created_at &gt; ?', self.id, Time.zone.now.to_s(:db), (Time.zone.now-interval).to_s(:db)]).to_i
     logger.debug(&quot;  *** average: #{average}, last_response_time: #{self.last_response_time}&quot;)
-    return average == 0 ? nil : (average.to_f / self.last_response_time.to_f * 100.0).to_i
+    return (average == 0 || last_response_time == 0) ? nil : (average.to_f / self.last_response_time.to_f * 100.0).to_i
   end
   
   private</diff>
      <filename>app/models/watch.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,7 +73,7 @@ module Mouse
       # updates the watch record
       def update_watch(watch, time, status)
         watch.status_id = status
-        watch.last_status_change_at = Time.now.to_s(:db) if watch.changed?  # only updates the last status change
+        watch.last_status_change_at = Time.zone.now.to_s(:db) if watch.changed?  # only updates the last status change
         watch.last_response_time = time
         return watch.save
       end</diff>
      <filename>lib/mouse/lib/engine.rb</filename>
    </modified>
    <modified>
      <diff>@@ -145,6 +145,8 @@ watchBlock = {
     // it was _slower_ than the average by 25%. 110 would be 10% faster than the average
     var new_color = this.calculateColor(data.from_average);
     
+    console.info('watch_id:',data.id,' css:',data.status.css);
+    
     switch (data.status.css) {
     case 'up':
       var new_color = this.calculateColor(data.from_average);</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5f9e37bdc026f06e6c9ed4c756e6f3286a04d796</id>
    </parent>
  </parents>
  <author>
    <name>Cannikin</name>
    <email>cannikinn@gmail.com</email>
  </author>
  <url>http://github.com/cannikin/owl/commit/17abc381b3e8efe4c96d0279e77685ecac939499</url>
  <id>17abc381b3e8efe4c96d0279e77685ecac939499</id>
  <committed-date>2009-11-04T11:43:50-08:00</committed-date>
  <authored-date>2009-11-04T11:43:50-08:00</authored-date>
  <message>Trying to get up/down status resolved</message>
  <tree>eaf9dd880e810f7792b12973da771b81dff36fd5</tree>
  <committer>
    <name>Cannikin</name>
    <email>cannikinn@gmail.com</email>
  </committer>
</commit>
