From: Adam Dickmeiss Date: Thu, 3 Sep 2015 07:31:20 +0000 (+0200) Subject: Tweak logging for session create/destroy X-Git-Tag: v1.12.3~7 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=cd5d11b2abd121a03a1075f7525112e7597cbc09;p=pazpar2-moved-to-github.git Tweak logging for session create/destroy Now logs sessions in use total, NMEM usage for session and last operation. --- diff --git a/src/session.c b/src/session.c index 4145974..a294c8e 100644 --- a/src/session.c +++ b/src/session.c @@ -1050,7 +1050,9 @@ void session_destroy(struct session *se) struct session_database *sdb; int i = session_use(-1); - session_log(se, YLOG_LOG, "destroy %d", i); + session_log(se, YLOG_LOG, "destroy " + "session-total %d nmem-op %zd nmem-ses %zd", i, + nmem_total(se->nmem), nmem_total(se->session_nmem)); session_remove_cached_clients(se); for (sdb = se->databases; sdb; sdb = sdb->next) @@ -1060,10 +1062,6 @@ void session_destroy(struct session *se) reclist_destroy(se->reclist); xfree(se->mergekey); xfree(se->rank); - if (nmem_total(se->nmem)) - session_log(se, YLOG_DEBUG, "NMEN operation usage %zd", nmem_total(se->nmem)); - if (nmem_total(se->session_nmem)) - session_log(se, YLOG_DEBUG, "NMEN session usage %zd", nmem_total(se->session_nmem)); facet_limits_destroy(se->facet_limits); nmem_destroy(se->nmem); service_destroy(se->service); @@ -1124,7 +1122,7 @@ struct session *new_session(NMEM nmem, struct conf_service *service, pazpar2_mutex_create(&session->session_mutex, tmp_str); i = session_use(1); - session_log(session, YLOG_LOG, "create %d", i); + session_log(session, YLOG_LOG, "create session-total %d", i); return session; }