Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2004-09-27 21:24:51 UTC

Modified files:
     include/userload.h ircd/userload.c

Log message:

Doxyfy userload.h and userload.c.

---------------------- diff included ----------------------
Index: ircu2.10/include/userload.h
diff -u ircu2.10/include/userload.h:1.4 ircu2.10/include/userload.h:1.5
--- ircu2.10/include/userload.h:1.4     Sat Sep 11 20:53:44 2004
+++ ircu2.10/include/userload.h Mon Sep 27 14:24:41 2004
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: userload.h,v 1.4 2004/09/12 03:53:44 entrope Exp $
+ * $Id: userload.h,v 1.5 2004/09/27 21:24:41 entrope Exp $
  */
 #ifndef INCLUDED_userload_h
 #define INCLUDED_userload_h
@@ -32,10 +32,11 @@
  * Structures
  */
 
+/** Tracks load of various types of users. */
 struct current_load_st {
-  unsigned int client_count;
-  unsigned int local_count;
-  unsigned int conn_count;
+  unsigned int client_count; /**< Count of locally connected clients. */
+  unsigned int local_count; /**< This field is updated but apparently meaningless. */
+  unsigned int conn_count; /**< Locally connected clients plus servers. */
 };
 
 /*
Index: ircu2.10/ircd/userload.c
diff -u ircu2.10/ircd/userload.c:1.9 ircu2.10/ircd/userload.c:1.10
--- ircu2.10/ircd/userload.c:1.9        Sat Sep 11 20:53:44 2004
+++ ircu2.10/ircd/userload.c    Mon Sep 27 14:24:41 2004
@@ -23,7 +23,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: userload.c,v 1.9 2004/09/12 03:53:44 entrope Exp $
+ * $Id: userload.c,v 1.10 2004/09/27 21:24:41 entrope Exp $
  */
 #include "config.h"
 
@@ -43,21 +43,19 @@
 #include <string.h>
 #include <time.h>
 
-struct current_load_st current_load;    /* The current load */
+struct current_load_st current_load;    /**< The current load */
 
-static struct current_load_st cspm_sum; /* Number of connections times number
+static struct current_load_st cspm_sum; /**< Number of connections times number
                                            of seconds per minute. */
-static struct current_load_st csph_sum; /* Number of connections times number
+static struct current_load_st csph_sum; /**< Number of connections times number
                                            of seconds per hour. */
-static struct current_load_st cspm[60]; /* Last 60 minutes */
-static struct current_load_st csph[72]; /* Last 72 hours */
+static struct current_load_st cspm[60]; /**< Last 60 minutes */
+static struct current_load_st csph[72]; /**< Last 72 hours */
 
-static int m_index, h_index;    /* Array indexes */
+static int m_index; /**< Next entry to use in #cspm. */
+static int h_index; /**< Next entry to use in #csph. */
 
-/*
- * update_load
- *
- * A new connection was added or removed.
+/** Update load average to reflect a change in the local client count.
  */
 void update_load(void)
 {
@@ -201,6 +199,11 @@
   last = CurrentTime;
 }
 
+/** Statistics callback to display userload.
+ * @param[in] sptr Client requesting statistics.
+ * @param[in] sd Stats descriptor for request (ignored).
+ * @param[in] param Extra parameter from user (ignored).
+ */
 void
 calc_load(struct Client *sptr, const struct StatDesc *sd, char *param)
 {
@@ -257,6 +260,7 @@
                  times[2][i], times[3][i], times[4][i], what[i]);
 }
 
+/** Initialize the userload statistics. */
 void initload(void)
 {
   memset(&current_load, 0, sizeof(current_load));
----------------------- End of diff -----------------------

Reply via email to