summaryrefslogtreecommitdiff
path: root/logger.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2016-06-12 21:57:02 -0700
committerdormando <dormando@rydia.net>2016-06-16 17:14:35 -0700
commit0503b5e2e90f3056c9a034f4fee07782b2c82f5d (patch)
treec871235292d807b34a6fe8425b62f0f658429ab2 /logger.h
parentec7a2e02a36f4f1ff5fc0d8c6b0e36e06808a9b8 (diff)
downloadmemcached-0503b5e2e90f3056c9a034f4fee07782b2c82f5d.tar.gz
some global stats for bg logger
four obvious ones. have a handy place to do the summarization when the logger wakes up for its run, avoiding the locks.
Diffstat (limited to 'logger.h')
-rw-r--r--logger.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/logger.h b/logger.h
index a244fa1..9d17616 100644
--- a/logger.h
+++ b/logger.h
@@ -64,7 +64,7 @@ typedef struct _logger {
struct _logger *prev;
struct _logger *next;
pthread_mutex_t mutex; /* guard for this + *buf */
- uint64_t logged; /* entries written to the buffer */
+ uint64_t written; /* entries written to the buffer */
uint64_t dropped; /* entries dropped */
uint64_t blocked; /* times blocked instead of dropped */
uint16_t fetcher_ratio; /* log one out of every N fetches */
@@ -90,6 +90,14 @@ typedef struct {
bipbuf_t *buf; /* per-watcher output buffer */
} logger_watcher;
+
+struct logger_stats {
+ uint64_t worker_dropped;
+ uint64_t worker_written;
+ uint64_t watcher_skipped;
+ uint64_t watcher_sent;
+};
+
extern pthread_key_t logger_key;
/* public functions */