From: Jiří Filipovič Date: Mon, 18 Oct 2010 12:52:38 +0000 (+0000) Subject: - fixed statistics when some full cells are out of queried interval X-Git-Tag: glite-lb-server_R_2_1_12_1~2 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=0e17516991aaf562aa9d30e77f1140d9371d5fb9;p=jra1mw.git - fixed statistics when some full cells are out of queried interval - remove negative values from from-to statistics --- diff --git a/org.glite.lb.server/src/stats.c b/org.glite.lb.server/src/stats.c index 96e7080..735b9a7 100644 --- a/org.glite.lb.server/src/stats.c +++ b/org.glite.lb.server/src/stats.c @@ -489,7 +489,7 @@ static int stats_record_duration_fromto( time_t base = to->stateEnterTimes[stats->base_state+1]; time_t final = to->stateEnterTimes[stats->final_state+1]; time_t timedif = final-base; - if (base && final){ /* final should be always not null*/ + if (base && final && (final > base)){ /* final should be always not null*/ a = g->archive; for (i=0; stats->archives[i].interval; i++) { @@ -667,6 +667,8 @@ static int stateRateRequest( glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "search %ld in %ld, %ld", *from, afrom, afrom+i); + diff = 0.0f; + // (from, to) is inside (afrom, afrom+i) if (*from >= afrom && *to < afrom+i) { diff = *to - *from; @@ -892,6 +894,8 @@ static int stateDurationFromToRequest( glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_DEBUG, "search %ld in %ld, %ld", *from, afrom, afrom+i); + diff = 0.0f; + // (from, to) is inside (afrom, afrom+i) if (*from >= afrom && *to < afrom+i) { diff = *to - *from;