Branch: Tag:

2009-11-18

2009-11-18 16:08:44 by Martin Stjernholm <mast@lysator.liu.se>

Fixed overwritten real time fed to log_event.

Rev: server/base_server/cache.pike:1.108

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS. - // $Id: cache.pike,v 1.107 2009/11/18 16:05:40 mast Exp $ + // $Id: cache.pike,v 1.108 2009/11/18 16:08:44 mast Exp $      #include <roxen.h>   #include <config.h>
1240:    mgr->after_gc();       vt = gethrvtime() - vt; // -1 - -1 if cpu time isn't working. -  t = vt || gethrtime() - t; +  t = gethrtime() - t;    CACHE_WERR ("Finished RAM cache cleanup - took %s.\n", -  Roxen.format_hrtime (t)); +  Roxen.format_hrtime (vt || t));       int stat_last_period = now - last_gc_run;    int stat_tot_period = now - cache_start_time;
1256:    // GC intervals are larger than the statistics interval, so just    // set the values. Note that stat_last_period is very large on the    // first call since last_gc_run is zero, so we always get here then. -  sum_gc_time = (float) t; +  sum_gc_time = (float) (vt || t);    sum_gc_runs = 1.0;    avg_destruct_garbage_size = (float) destr_garb_size;    avg_timeout_garbage_size = (float) timeout_garb_size;
1264:       else {    if (startup) { -  sum_gc_time += (float) t; +  sum_gc_time += (float) (vt || t);    sum_gc_runs += 1.0;    }    else {    sum_gc_runs = weight_old * sum_gc_runs + 1.0; -  sum_gc_time = weight_old * sum_gc_time + (float) t; +  sum_gc_time = weight_old * sum_gc_time + (float) (vt || t);    } -  +     avg_destruct_garbage_size = (weight_old * avg_destruct_garbage_size +    weight_last * (float) destr_garb_size);    avg_timeout_garbage_size = (weight_old * avg_timeout_garbage_size +