make is_cti/is_sti collect times connected in unsigned long long instead of time_t as well..on 32bit boxes that is going to wrap pretty quickly

committer: Valeriy Yatsko <dwr@it-penza.org>
This commit is contained in:
Aaron Sethman 2008-11-16 10:04:09 +03:00
parent 59eedf155f
commit 17d00839b3
3 changed files with 8 additions and 8 deletions

View File

@ -49,8 +49,8 @@ struct ServerStatistics
unsigned long long int is_cbr; /* bytes received to clients */ unsigned long long int is_cbr; /* bytes received to clients */
unsigned long long int is_sbs; /* bytes sent to servers */ unsigned long long int is_sbs; /* bytes sent to servers */
unsigned long long int is_sbr; /* bytes received to servers */ unsigned long long int is_sbr; /* bytes received to servers */
time_t is_cti; /* time spent connected by clients */ unsigned long long int is_cti; /* time spent connected by clients */
time_t is_sti; /* time spent connected by servers */ unsigned long long int is_sti; /* time spent connected by servers */
unsigned int is_ac; /* connections accepted */ unsigned int is_ac; /* connections accepted */
unsigned int is_ref; /* accepts refused */ unsigned int is_ref; /* accepts refused */
unsigned int is_unco; /* unknown commands */ unsigned int is_unco; /* unknown commands */

View File

@ -852,7 +852,7 @@ stats_tstats (struct Client *source_p)
sp.is_sbs += target_p->localClient->sendB; sp.is_sbs += target_p->localClient->sendB;
sp.is_sbr += target_p->localClient->receiveB; sp.is_sbr += target_p->localClient->receiveB;
sp.is_sti += rb_current_time() - target_p->localClient->firsttime; sp.is_sti += (unsigned long long)(rb_current_time() - target_p->localClient->firsttime);
sp.is_sv++; sp.is_sv++;
} }
@ -862,7 +862,7 @@ stats_tstats (struct Client *source_p)
sp.is_cbs += target_p->localClient->sendB; sp.is_cbs += target_p->localClient->sendB;
sp.is_cbr += target_p->localClient->receiveB; sp.is_cbr += target_p->localClient->receiveB;
sp.is_cti += rb_current_time() - target_p->localClient->firsttime; sp.is_cti += (unsigned long long)(rb_current_time() - target_p->localClient->firsttime);
sp.is_cl++; sp.is_cl++;
} }
@ -911,8 +911,8 @@ stats_tstats (struct Client *source_p)
sp.is_cbr / 1024, sp.is_cbr / 1024,
sp.is_sbr / 1024); sp.is_sbr / 1024);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :time connected %lu %lu", "T :time connected %llu %llu",
(long int)sp.is_cti, (long int)sp.is_sti); sp.is_cti, sp.is_sti);
} }
static void static void

View File

@ -1882,7 +1882,7 @@ close_connection(struct Client *client_p)
ServerStats.is_sv++; ServerStats.is_sv++;
ServerStats.is_sbs += client_p->localClient->sendB; ServerStats.is_sbs += client_p->localClient->sendB;
ServerStats.is_sbr += client_p->localClient->receiveB; ServerStats.is_sbr += client_p->localClient->receiveB;
ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime; ServerStats.is_sti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
/* /*
* If the connection has been up for a long amount of time, schedule * If the connection has been up for a long amount of time, schedule
@ -1908,7 +1908,7 @@ close_connection(struct Client *client_p)
ServerStats.is_cl++; ServerStats.is_cl++;
ServerStats.is_cbs += client_p->localClient->sendB; ServerStats.is_cbs += client_p->localClient->sendB;
ServerStats.is_cbr += client_p->localClient->receiveB; ServerStats.is_cbr += client_p->localClient->receiveB;
ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime; ServerStats.is_cti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
} }
else else
ServerStats.is_ni++; ServerStats.is_ni++;