Doxyfy userload.h and userload.c.
authorMichael Poole <mdpoole@troilus.org>
Mon, 27 Sep 2004 21:24:41 +0000 (21:24 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 27 Sep 2004 21:24:41 +0000 (21:24 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1180 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

include/userload.h
ircd/userload.c

index 2f95ade26ce2e7eeeeca9cbafffd4570c910f232..4268c9aa9b677e7f6fd7c91723f896510975a025 100644 (file)
@@ -32,10 +32,11 @@ struct StatDesc;
  * 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 af8404e2fa6fef54e56586ff0555033d2562d5a0..b53fbf4582541354600c32c242a5f59b95a80d6c 100644 (file)
 #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 @@ void update_load(void)
   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 @@ calc_load(struct Client *sptr, const struct StatDesc *sd, char *param)
                  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));