summaryrefslogtreecommitdiff
path: root/logger.h
diff options
context:
space:
mode:
authorKevin Lin <developer@kevinlin.info>2021-05-29 22:19:43 -0700
committerdormando <dormando@rydia.net>2021-08-07 01:16:14 -0700
commit617d7cd64d04698b76fee74882627690017e20ad (patch)
treede5c4b129c419ba32e1a403d58871bd0f05da25d /logger.h
parenta54f34f34c3ddef3f6e13f62f3ab673f681cac95 (diff)
downloadmemcached-617d7cd64d04698b76fee74882627690017e20ad.tar.gz
Implement LOG_CONNEVENTS watcher flag for connection state transitions
Add support for `watch connevents` to report opened (`conn_new`) and closed (`conn_close`) client connections. Event log lines indicate the connection's remote IP, remote port, and transport type. `conn_close` events additionally supply a reason for the closing the connection.
Diffstat (limited to 'logger.h')
-rw-r--r--logger.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/logger.h b/logger.h
index 715f3af..5492f72 100644
--- a/logger.h
+++ b/logger.h
@@ -20,6 +20,8 @@ enum log_entry_type {
LOGGER_ITEM_STORE,
LOGGER_CRAWLER_STATUS,
LOGGER_SLAB_MOVE,
+ LOGGER_CONNECTION_NEW,
+ LOGGER_CONNECTION_CLOSE,
#ifdef EXTSTORE
LOGGER_EXTSTORE_WRITE,
LOGGER_COMPACT_START,
@@ -36,6 +38,8 @@ enum log_entry_subtype {
LOGGER_EVICTION_ENTRY,
LOGGER_ITEM_GET_ENTRY,
LOGGER_ITEM_STORE_ENTRY,
+ LOGGER_CONNECTION_NEW_ENTRY,
+ LOGGER_CONNECTION_CLOSE_ENTRY,
#ifdef EXTSTORE
LOGGER_EXT_WRITE_ENTRY,
#endif
@@ -101,6 +105,13 @@ struct logentry_item_store {
char key[];
};
+struct logentry_conn_event {
+ int transport;
+ int reason;
+ int sfd;
+ struct sockaddr addr;
+};
+
/* end intermediary structures */
/* WARNING: cuddled items aren't compatible with warm restart. more code