[email protected] wrote: > Author: jim > Date: Thu Nov 15 18:49:17 2012 > New Revision: 1409924 > > URL: http://svn.apache.org/viewvc?rev=1409924&view=rev > Log: > * core: Add in ap_get_sload() and ap_get_loadavg(). > > > Modified: > httpd/httpd/branches/2.4.x/ (props changed) > httpd/httpd/branches/2.4.x/CHANGES > httpd/httpd/branches/2.4.x/STATUS > httpd/httpd/branches/2.4.x/configure.in > httpd/httpd/branches/2.4.x/docs/manual/ (props changed) > httpd/httpd/branches/2.4.x/include/httpd.h > httpd/httpd/branches/2.4.x/modules/generators/mod_status.c > httpd/httpd/branches/2.4.x/server/util.c > > Propchange: httpd/httpd/branches/2.4.x/
> > Modified: httpd/httpd/branches/2.4.x/include/httpd.h > URL: > http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/httpd.h?rev=1409924&r1=1409923&r2=1409924&view=diff > ============================================================================== > --- httpd/httpd/branches/2.4.x/include/httpd.h (original) > +++ httpd/httpd/branches/2.4.x/include/httpd.h Thu Nov 15 18:49:17 2012 > @@ -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,18 @@ AP_DECLARE(void *) ap_realloc(void *ptr, > 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); > + > > #define AP_NORESTART APR_OS_START_USEERR + 1 Don't we need a minor bump because of these additional structures / functions? Regards RĂ¼diger
