ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-8/modules/m_stats.c
(Generate patch)

Comparing ircd-hybrid-7.2/modules/m_stats.c (file contents):
Revision 584 by michael, Sun May 7 15:26:45 2006 UTC vs.
Revision 884 by michael, Sun Oct 28 18:22:55 2007 UTC

# Line 51 | Line 51
51   #include "resv.h"  /* report_resv */
52   #include "whowas.h"
53   #include "list.h"
54 + #include "watch.h"
55  
56   static void do_stats(struct Client *, int, char **);
57   static void m_stats(struct Client *, struct Client *, int, char *[]);
# Line 390 | Line 391 | count_memory(struct Client *source_p)
391  
392    int wwu = 0;                  /* whowas users */
393    int class_count = 0;          /* classes */
393  int users_invited_count = 0;  /* users invited */
394    int aways_counted = 0;
395    int number_ips_stored;        /* number of ip addresses hashed */
396  
# Line 423 | Line 423 | count_memory(struct Client *source_p)
423    unsigned long total_memory = 0;
424    unsigned int topic_count = 0;
425  
426 +  unsigned int wlh = 0;   /* watchlist headers     */
427 +  unsigned int wle = 0;   /* watchlist entries     */
428 +  size_t wlhm = 0; /* watchlist memory used */
429 +
430    count_whowas_memory(&wwu, &wwm);
431  
432    DLINK_FOREACH(gptr, global_client_list.head)
# Line 433 | Line 437 | count_memory(struct Client *source_p)
437      {
438        ++local_client_count;
439        local_client_conf_count += dlink_list_length(&target_p->localClient->confs);
440 <      users_invited_count += dlink_list_length(&target_p->localClient->invited);
440 >      wle += dlink_list_length(&target_p->localClient->watches);
441      }
442      else
443        ++remote_client_count;
# Line 537 | Line 541 | count_memory(struct Client *source_p)
541    /* count up all classes */
542    class_count = dlink_list_length(&class_items);
543  
544 <  sendto_one(source_p, ":%s %d %s z :Clients %u(%lu) Invites %u(%lu)",
544 >  watch_count_memory(&wlh, &wlhm);
545 >
546 >  sendto_one(source_p, ":%s %d %s z :WATCH headers %u(%u) entries %d(%d)",
547 >             me.name, RPL_STATSDEBUG, source_p->name, wlh, wlhm, wle,
548 >             wle * sizeof(dlink_node));
549 >
550 >  sendto_one(source_p, ":%s %d %s z :Clients %u(%u)",
551               me.name, RPL_STATSDEBUG, source_p->name, users_counted,
552 <             (unsigned long)(users_counted * sizeof(struct Client)),
543 <             users_invited_count, (unsigned long)(users_invited_count * sizeof(dlink_node)));
552 >             (users_counted * sizeof(struct Client)));
553  
554    sendto_one(source_p, ":%s %d %s z :User aways %u(%d)",
555               me.name, RPL_STATSDEBUG, source_p->name,
556               aways_counted, (int)away_memory);
557  
558 <  sendto_one(source_p, ":%s %d %s z :Attached confs %u(%lu)",
558 >  sendto_one(source_p, ":%s %d %s z :Attached confs %u(%u)",
559               me.name, RPL_STATSDEBUG, source_p->name,
560               local_client_conf_count,
561               (unsigned long)(local_client_conf_count * sizeof(dlink_node)));
# Line 587 | Line 596 | count_memory(struct Client *source_p)
596               me.name, RPL_STATSDEBUG, source_p->name,
597               channel_invex, channel_invex_memory);
598  
599 <  sendto_one(source_p, ":%s %d %s z :Channel members %u(%lu) invite %u(%lu)",
599 >  sendto_one(source_p, ":%s %d %s z :Channel members %u(%lu) invites %u(%lu)",
600               me.name, RPL_STATSDEBUG, source_p->name, channel_users,
601               (unsigned long)(channel_users * sizeof(struct Membership)),
602               channel_invites, (unsigned long)channel_invites *
603 <             sizeof(dlink_node));
603 >             sizeof(dlink_node) * 2);
604  
605    total_channel_memory = channel_memory + channel_ban_memory +
606                           channel_users * sizeof(struct Membership) +
607 <                         channel_invites * sizeof(dlink_node);
607 >                         (channel_invites * sizeof(dlink_node)*2);
608  
609    sendto_one(source_p, ":%s %d %s z :Safelist %u(%u)",
610               me.name, RPL_STATSDEBUG, source_p->name,
# Line 869 | Line 878 | stats_glines(struct Client *source_p)
878  
879    for (; i < ATABLE_SIZE; ++i)
880    {
881 <    for (arec = atable[i]; arec; arec=arec->next)
881 >    for (arec = atable[i]; arec; arec = arec->next)
882      {
883        if (arec->type == CONF_GLINE)
884        {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines