Skip to content

Commit

Permalink
Print reload count in nscd statistics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Apr 9, 2010
1 parent 42464d7 commit d55d558
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
2010-04-08 Ulrich Drepper <drepper@redhat.com>

[BZ #10915]
* nscd/nscd_stat.c (struct statdata): Add reload_count field.
(send_stats): Fill in reload_count.
(receive_print_stats): Print reload_count.

* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): When
reading the loginuid file use a buffer which is always large enough.
NUL-terminate the string.
Expand Down
9 changes: 6 additions & 3 deletions nscd/nscd_stat.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 1998, 2003, 2004, 2005 Free Software Foundation, Inc.
/* Copyright (c) 1998, 2003, 2004, 2005, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
Expand Down Expand Up @@ -80,6 +80,7 @@ struct statdata
int max_nthreads;
int paranoia;
time_t restart_interval;
unsigned int reload_count;
int ndbs;
struct dbstat dbs[lastdb];
#ifdef HAVE_SELINUX
Expand All @@ -102,6 +103,7 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
data.max_nthreads = max_nthreads;
data.paranoia = paranoia;
data.restart_interval = restart_interval;
data.reload_count = reload_count;
data.ndbs = lastdb;

for (cnt = 0; cnt < lastdb; ++cnt)
Expand Down Expand Up @@ -240,10 +242,11 @@ receive_print_stats (void)
"%15d maximum number of threads\n"
"%15lu number of times clients had to wait\n"
"%15s paranoia mode enabled\n"
"%15lu restart internal\n"),
"%15lu restart internal\n"
"%15u reload count\n"),
data.nthreads, data.max_nthreads, data.client_queued,
data.paranoia ? yesstr : nostr,
(unsigned long int) data.restart_interval);
(unsigned long int) data.restart_interval, data.reload_count);

for (i = 0; i < lastdb; ++i)
{
Expand Down

0 comments on commit d55d558

Please sign in to comment.