Ticket #153 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

window_robust_derive missing first and last rows.

Reported by: jesus Assigned to: jesus
Priority: major Milestone: Wangle
Component: database Severity: serious
Keywords: Cc:


If I start with acompletely fresh install add one http check, fire up the standard

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 doomed.

  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;

Change History

07/10/09 00:26:55 changed by jesus

  • status changed from new to closed.
  • resolution set to fixed.

(In [783]) Patch from Dan. fixes #153