summaryrefslogtreecommitdiff
path: root/include/httpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/httpd.h')
-rw-r--r--include/httpd.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/include/httpd.h b/include/httpd.h
index 461cf5ee..70eb06f9 100644
--- a/include/httpd.h
+++ b/include/httpd.h
@@ -1151,7 +1151,7 @@ struct conn_rec {
/** This points to the current thread being used to process this request,
* over the lifetime of a request, the value may change. Users of the connection
- * record should not rely upon it staying the same between calls that invole
+ * record should not rely upon it staying the same between calls that involve
* the MPM.
*/
#if APR_HAS_THREADS
@@ -1299,6 +1299,36 @@ struct server_rec {
};
/**
+ * @struct ap_sload_t
+ * @brief A structure to hold server load params
+ */
+typedef struct ap_sload_t ap_sload_t;
+struct ap_sload_t {
+ /* percentage of process/threads ready/idle (0->100)*/
+ int idle;
+ /* percentage of process/threads busy (0->100) */
+ int busy;
+ /* total bytes served */
+ apr_off_t bytes_served;
+ /* total access count */
+ unsigned long access_count;
+};
+
+/**
+ * @struct ap_loadavg_t
+ * @brief A structure to hold various server loadavg
+ */
+typedef struct ap_loadavg_t ap_loadavg_t;
+struct ap_loadavg_t {
+ /* current loadavg, ala getloadavg() */
+ float loadavg;
+ /* 5 min loadavg */
+ float loadavg5;
+ /* 15 min loadavg */
+ float loadavg15;
+};
+
+/**
* Get the context_document_root for a request. This is a generalization of
* the document root, which is too limited in the presence of mappers like
* mod_userdir and mod_alias. The context_document_root is the directory
@@ -2167,6 +2197,26 @@ AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
AP_FN_ATTR_WARN_UNUSED_RESULT
AP_FN_ATTR_ALLOC_SIZE(2);
+/**
+ * Get server load params
+ * @param ld struct to populate: -1 in fields means error
+ */
+AP_DECLARE(void) ap_get_sload(ap_sload_t *ld);
+
+/**
+ * Get server load averages (ala getloadavg)
+ * @param ld struct to populate: -1 in fields means error
+ */
+AP_DECLARE(void) ap_get_loadavg(ap_loadavg_t *ld);
+
+/**
+ * Convert binary data into a hex string
+ * @param src pointer to the data
+ * @param srclen length of the data
+ * @param dest pointer to buffer of length (2 * srclen + 1). The resulting
+ * string will be NUL-terminated.
+ */
+AP_DECLARE(void) ap_bin2hex(const void *src, apr_size_t srclen, char *dest);
#define AP_NORESTART APR_OS_START_USEERR + 1