Log the duration of garbage collection at level 3.

This commit is contained in:
ivanr 2010-02-03 07:29:54 +00:00
parent 5c4733f1ab
commit 5448b3fc26
2 changed files with 8 additions and 3 deletions

View File

@ -167,7 +167,7 @@ static apr_status_t modsecurity_tx_cleanup(void *data) {
int collect_garbage = 0;
int i;
char *my_error_msg = NULL;
apr_time_t time_before;
apr_time_t time_before, duration;
if (msr == NULL) return APR_SUCCESS;
@ -192,8 +192,13 @@ static apr_status_t modsecurity_tx_cleanup(void *data) {
collections_remove_stale(msr, te[i].key);
}
}
duration = apr_time_now() - time_before;
msr->time_storage_write += duration;
msr->time_storage_write += apr_time_now() - time_before;
if (msr->txcfg->debuglog_level >= 3) {
msr_log(msr, 3, "Garbage collection took %" APR_TIME_T_FMT " microseconds.", duration);
}
/* Multipart processor cleanup. */
if (msr->mpd != NULL) multipart_cleanup(msr);

View File

@ -775,7 +775,7 @@ void msre_engine_destroy(msre_engine *engine) {
*/
#if defined(PERFORMANCE_MEASUREMENT)
#define PERFORMANCE_MEASUREMENT_LOOP 1000
#define PERFORMANCE_MEASUREMENT_LOOP 5000
static apr_status_t msre_ruleset_process_phase_(msre_ruleset *ruleset, modsec_rec *msr);