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

Comparing ircd-hybrid/trunk/modules/m_stats.c (file contents):
Revision 6718 by michael, Fri Oct 30 17:37:27 2015 UTC vs.
Revision 6719 by michael, Fri Oct 30 18:18:07 2015 UTC

# Line 317 | Line 317 | stats_memory(struct Client *source_p, in
317    unsigned int aways_counted = 0;
318    unsigned int number_ips_stored = 0;        /* number of ip addresses hashed */
319  
320 <  uint64_t channel_memory = 0;
321 <  uint64_t channel_ban_memory = 0;
322 <  uint64_t channel_except_memory = 0;
323 <  uint64_t channel_invex_memory = 0;
320 >  size_t channel_memory = 0;
321 >  size_t channel_ban_memory = 0;
322 >  size_t channel_except_memory = 0;
323 >  size_t channel_invex_memory = 0;
324  
325    unsigned int safelist_count = 0;
326 <  uint64_t safelist_memory = 0;
326 >  size_t safelist_memory = 0;
327  
328 <  uint64_t wwm = 0;               /* whowas array memory used       */
329 <  uint64_t conf_memory = 0;       /* memory used by conf lines      */
330 <  uint64_t mem_ips_stored = 0;        /* memory used by ip address hash */
328 >  size_t wwm = 0;               /* whowas array memory used       */
329 >  size_t conf_memory = 0;       /* memory used by conf lines      */
330 >  size_t mem_ips_stored = 0;        /* memory used by ip address hash */
331  
332 <  uint64_t total_channel_memory = 0;
333 <  uint64_t totww = 0;
332 >  size_t total_channel_memory = 0;
333 >  size_t totww = 0;
334  
335    unsigned int local_client_count  = 0;
336    unsigned int remote_client_count = 0;
337  
338 <  uint64_t local_client_memory_used  = 0;
339 <  uint64_t remote_client_memory_used = 0;
338 >  size_t local_client_memory_used  = 0;
339 >  size_t remote_client_memory_used = 0;
340  
341 <  uint64_t total_memory = 0;
341 >  size_t total_memory = 0;
342    unsigned int topic_count = 0;
343  
344    unsigned int watch_list_headers = 0;   /* watchlist headers     */
345    unsigned int watch_list_entries = 0;   /* watchlist entries     */
346 <  uint64_t watch_list_memory = 0; /* watchlist memory used */
346 >  size_t watch_list_memory = 0; /* watchlist memory used */
347  
348  
349    DLINK_FOREACH(gptr, global_client_list.head)
# Line 439 | Line 439 | stats_memory(struct Client *source_p, in
439                       "z :User aways %u", aways_counted);
440  
441    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
442 <                     "z :Attached confs %u(%llu)",
442 >                     "z :Attached confs %u(%zu)",
443                       local_client_conf_count,
444 <                     (unsigned long long)(local_client_conf_count * sizeof(dlink_node)));
444 >                     local_client_conf_count * sizeof(dlink_node));
445  
446    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
447 <                     "z :Resv channels %u(%lu) nicks %u(%lu)",
447 >                     "z :Resv channels %u(%zu) nicks %u(%zu)",
448                       dlink_list_length(&cresv_items),
449                       dlink_list_length(&cresv_items) * sizeof(struct MaskItem),
450                       dlink_list_length(&nresv_items),
451                       dlink_list_length(&nresv_items) * sizeof(struct MaskItem));
452  
453    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
454 <                     "z :Classes %u(%llu)",
455 <                     class_count, (unsigned long long)(class_count * sizeof(struct ClassItem)));
454 >                     "z :Classes %u(%zu)",
455 >                     class_count, class_count * sizeof(struct ClassItem));
456  
457    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
458 <                     "z :Channels %u(%llu) Topics %u(%u)",
458 >                     "z :Channels %u(%zu) Topics %u(%u)",
459                       dlink_list_length(&channel_list),
460                       channel_memory, topic_count, topic_count *
461                       (TOPICLEN + 1 + USERHOST_REPLYLEN));
462  
463    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
464 <                     "z :Bans %u(%llu)",
464 >                     "z :Bans %u(%zu)",
465                       channel_bans, channel_ban_memory);
466  
467    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
468 <                     "z :Exceptions %u(%llu)",
468 >                     "z :Exceptions %u(%zu)",
469                       channel_except, channel_except_memory);
470  
471    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
472 <                     "z :Invex %u(%llu)",
472 >                     "z :Invex %u(%zu)",
473                       channel_invex, channel_invex_memory);
474  
475    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
476 <                     "z :Channel members %u(%llu) invites %u(%llu)",
476 >                     "z :Channel members %u(%zu) invites %u(%zu)",
477                       channel_members,
478 <                     (unsigned long long)(channel_members * sizeof(struct Membership)),
479 <                     channel_invites, (unsigned long long)channel_invites * sizeof(dlink_node) * 2);
478 >                     channel_members * sizeof(struct Membership),
479 >                     channel_invites,
480 >                     channel_invites * sizeof(dlink_node) * 2);
481  
482    total_channel_memory = channel_memory + channel_ban_memory +
483                           channel_members * sizeof(struct Membership) +
484 <                         (channel_invites * sizeof(dlink_node)*2);
484 >                         (channel_invites * sizeof(dlink_node) * 2);
485  
486    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
487 <                     "z :Safelist %u(%llu)",
487 >                     "z :Safelist %u(%zu)",
488                       safelist_count, safelist_memory);
489  
490    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
491 <                     "z :Whowas users %u(%llu)",
492 <                     wwu, (unsigned long long)(wwu * sizeof(struct Client)));
491 >                     "z :Whowas users %u(%zu)",
492 >                     wwu, wwu * sizeof(struct Client));
493  
494    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
495 <                     "z :Whowas array %u(%llu)",
495 >                     "z :Whowas array %u(%zu)",
496                       NICKNAMEHISTORYLENGTH, wwm);
497  
498    totww = wwu * sizeof(struct Client) + wwm;
# Line 499 | Line 500 | stats_memory(struct Client *source_p, in
500    motd_memory_count(source_p);
501    ipcache_get_stats(&number_ips_stored, &mem_ips_stored);
502    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
503 <                     "z :iphash %u(%llu)",
503 >                     "z :iphash %u(%zu)",
504                       number_ips_stored, mem_ips_stored);
505  
506    total_memory = totww + total_channel_memory + conf_memory + class_count *
507                   sizeof(struct ClassItem);
508    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
509 <                     "z :Total: whowas %llu channel %llu conf %llu",
509 >                     "z :Total: whowas %zu channel %zu conf %zu",
510                       totww, total_channel_memory, conf_memory);
511  
512    local_client_memory_used = local_client_count*(sizeof(struct Client) + sizeof(struct Connection));
513    total_memory += local_client_memory_used;
514    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
515 <                     "z :Local client Memory in use: %u(%llu)",
515 >                     "z :Local client Memory in use: %u(%zu)",
516                       local_client_count, local_client_memory_used);
517  
518    remote_client_memory_used = remote_client_count * sizeof(struct Client);
519    total_memory += remote_client_memory_used;
520    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
521 <                     "z :Remote client Memory in use: %u(%llu)",
521 >                     "z :Remote client Memory in use: %u(%zu)",
522                       remote_client_count, remote_client_memory_used);
523  
524    sendto_one_numeric(source_p, &me, RPL_STATSDEBUG | SND_EXPLICIT,
525 <                     "z :TOTAL: %llu",
525 >                     "z :TOTAL: %zu",
526                       me.name, RPL_STATSDEBUG, source_p->name,
527                       total_memory);
528   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines