]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
tstats stuff gone to m_stats.c
authorValery Yatsko <redacted>
Wed, 2 Apr 2008 12:04:43 +0000 (16:04 +0400)
committerValery Yatsko <redacted>
Wed, 2 Apr 2008 12:04:43 +0000 (16:04 +0400)
include/s_stats.h
modules/m_stats.c
src/ircd.c
src/s_stats.c

index d65f1651d65d15aa98f81b3a216ebcd8c8a402d6..2c611a437ce95a640b6da6020334a574d288976d 100644 (file)
@@ -76,9 +76,6 @@ struct ServerStatistics
 
 extern struct ServerStatistics ServerStats;
 
-extern void init_stats(void);
-extern void tstats(struct Client *client);
-
 extern void count_memory(struct Client *);
 
 #endif /* INCLUDED_s_stats_h */
index f264e35fdd1f47f10290651252f1001127c8f1e1..94b367f32e036031bc8ae539313b05967cc56477 100644 (file)
@@ -924,10 +924,73 @@ stats_usage (struct Client *source_p)
                           (int) rus.ru_nivcsw);
 }
 
-static void
-stats_tstats (struct Client *source_p)
-{
-       tstats (source_p);
+static void\r
+stats_tstats(struct Client *source_p)\r
+{\r
+       struct Client *target_p;\r
+       struct ServerStatistics sp;\r
+       rb_dlink_node *ptr;\r
+\r
+       memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));\r
+\r
+       RB_DLINK_FOREACH(ptr, serv_list.head)\r
+       {\r
+               target_p = ptr->data;\r
+\r
+               sp.is_sbs += target_p->localClient->sendB;\r
+               sp.is_sbr += target_p->localClient->receiveB;\r
+               sp.is_sti += rb_current_time() - target_p->localClient->firsttime;\r
+               sp.is_sv++;\r
+       }\r
+\r
+       RB_DLINK_FOREACH(ptr, lclient_list.head)\r
+       {\r
+               target_p = ptr->data;\r
+\r
+               sp.is_cbs += target_p->localClient->sendB;\r
+               sp.is_cbr += target_p->localClient->receiveB;\r
+               sp.is_cti += rb_current_time() - target_p->localClient->firsttime;\r
+               sp.is_cl++;\r
+       }\r
+\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :accepts %u refused %u", \r
+                               sp.is_ac, sp.is_ref);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :rejected %u delaying %lu", \r
+                               sp.is_rej, delay_exit_length());\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :nicks being delayed %lu", get_nd_count());\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :unknown commands %u prefixes %u",\r
+                               sp.is_unco, sp.is_unpf);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :nick collisions %u saves %u unknown closes %u",\r
+                               sp.is_kill, sp.is_save, sp.is_ni);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :wrong direction %u empty %u", \r
+                               sp.is_wrdi, sp.is_empt);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :numerics seen %u", \r
+                               sp.is_num);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :auth successes %u fails %u",\r
+                               sp.is_asuc, sp.is_abad);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :connected %u %u",\r
+                               sp.is_cl, sp.is_sv);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :bytes sent %lluK %lluK",\r
+                               sp.is_cbs / 1024, \r
+                               sp.is_sbs / 1024);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :bytes recv %lluK %lluK",\r
+                               sp.is_cbr / 1024, \r
+                               sp.is_sbr / 1024);\r
+       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
+                               "T :time connected %lu %lu",\r
+                               sp.is_cti, sp.is_sti);\r
 }
 
 static void
index b369b7e37065b9a1e23d0e97dd47e84e1b04e96b..e3c2cb95a24d558937fb893e3ce2eade0db46172 100644 (file)
@@ -578,7 +578,6 @@ main(int argc, char *argv[])
        init_channels();
        initclass();
        initwhowas();
-       init_stats();
        init_reject();
        init_cache();
        init_monitor();
index 42e4dec44e676fae27c4c313dced6832410b4cf9..86bf37f6685f799bf3936bcb13b33a4fa7204c4a 100644 (file)
  */
 struct ServerStatistics ServerStats;
 
-void
-init_stats()
-{
-       /* XXX nothing to do - was ServerStats init -- dwr */
-}
-
-/*
- * tstats
- *
- * inputs      - client to report to
- * output      - NONE 
- * side effects        -
- */
-void\r
-tstats(struct Client *source_p)\r
-{\r
-       struct Client *target_p;\r
-       struct ServerStatistics sp;\r
-       rb_dlink_node *ptr;\r
-\r
-       memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));\r
-\r
-       RB_DLINK_FOREACH(ptr, serv_list.head)\r
-       {\r
-               target_p = ptr->data;\r
-\r
-               sp.is_sbs += target_p->localClient->sendB;\r
-               sp.is_sbr += target_p->localClient->receiveB;\r
-               sp.is_sti += rb_current_time() - target_p->localClient->firsttime;\r
-               sp.is_sv++;\r
-       }\r
-\r
-       RB_DLINK_FOREACH(ptr, lclient_list.head)\r
-       {\r
-               target_p = ptr->data;\r
-\r
-               sp.is_cbs += target_p->localClient->sendB;\r
-               sp.is_cbr += target_p->localClient->receiveB;\r
-               sp.is_cti += rb_current_time() - target_p->localClient->firsttime;\r
-               sp.is_cl++;\r
-       }\r
-\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :accepts %u refused %u", \r
-                               sp.is_ac, sp.is_ref);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :rejected %u delaying %lu", \r
-                               sp.is_rej, delay_exit_length());\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :nicks being delayed %lu", get_nd_count());\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :unknown commands %u prefixes %u",\r
-                               sp.is_unco, sp.is_unpf);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :nick collisions %u saves %u unknown closes %u",\r
-                               sp.is_kill, sp.is_save, sp.is_ni);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :wrong direction %u empty %u", \r
-                               sp.is_wrdi, sp.is_empt);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :numerics seen %u", \r
-                               sp.is_num);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :auth successes %u fails %u",\r
-                               sp.is_asuc, sp.is_abad);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :connected %u %u",\r
-                               sp.is_cl, sp.is_sv);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :bytes sent %lluK %lluK",\r
-                               sp.is_cbs / 1024, \r
-                               sp.is_sbs / 1024);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :bytes recv %lluK %lluK",\r
-                               sp.is_cbr / 1024, \r
-                               sp.is_sbr / 1024);\r
-       sendto_one_numeric(source_p, RPL_STATSDEBUG,\r
-                               "T :time connected %lu %lu",\r
-                               sp.is_cti, sp.is_sti);\r
-}
-
 void
 count_memory(struct Client *source_p)
 {