[Reconnoiter-devel] [reconnoiter] #153: window_robust_derive missing first and last rows.

reconnoiter trac at labs.omniti.com
Thu Jul 9 20:07:45 EDT 2009

#153: window_robust_derive missing first and last rows.
 Reporter:  jesus     |       Owner:  jesus  
     Type:  defect    |      Status:  new    
 Priority:  major     |   Milestone:  Wangle 
Component:  database  |    Severity:  serious
 Keywords:            |  
 If I start with acompletely fresh install add one http check, fire up the
 config add a two checks, a self check and an http check.  Wait for 5
 mins @ 30 periods for a couple checks to come in and manually run the
 5m rollup window.  For some reason no bytes or uptime entries will
 show up in the 5m table.  So then I looked in the Stored Proc and saw
 the window_robust_derive, which does the whole roll up.  And for some
 reason it was leaving out uptime from the self check and bytes from
 the http check.

 So the bytes problem is because the rec.count_rows initially start as
 null and not 0, same with avg_value so I added right under the begin
 clause.  Since it was the first check to go through the system it was

   rec.count_rows := 0;
   rec.avg_value := 0;

 And then realized that the uptime check was the last to go through the
 system and the logic in the sproc basically rolls up until it hits a
 difference and then returns a new row.  Since this is the last row it
 never got returned so at the end of the loop I just copied the derive
 code and added it under the end loop;

 if rec.count_rows > 0 then
  rec.avg_value := rec.avg_value / rec.count_rows;
  if run is not null and run > 0 then
    rec.counter_dev := rise/run;
  end if;
  return next rec;
 end if;

Ticket URL: <http://labs.omniti.com/trac/reconnoiter/ticket/153>
reconnoiter <https://labs.omniti.com/trac/reconnoiter>

More information about the Reconnoiter-devel mailing list