diff options
author | dormando <dormando@rydia.net> | 2016-06-16 16:18:14 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2016-06-16 17:14:35 -0700 |
commit | c7fbcceb0ac9283020f239285428afc2f100c34b (patch) | |
tree | 4c60ec8c24ab49d1efb37bd4645e1a5380a71f30 /logger.h | |
parent | cb8257e342d4d691e146333f7684ebc754f9d36b (diff) | |
download | memcached-c7fbcceb0ac9283020f239285428afc2f100c34b.tar.gz |
logger endpoints for first release
swapping "RAWCMDS" for internal hooks on when items are fetched or stored.
This doesn't map 1:1 with commands, ie: a store is internally a fetch then
store, so two log lines are generated. An ascii multiget one make one log line
per key fetched.
It's a good place to start. Need to come back and refactor parts of logger.c
again, then convert all prints in the codebase to log entries.
Diffstat (limited to 'logger.h')
-rw-r--r-- | logger.h | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -12,12 +12,16 @@ enum log_entry_type { LOGGER_ASCII_CMD = 0, - LOGGER_EVICTION + LOGGER_EVICTION, + LOGGER_ITEM_GET, + LOGGER_ITEM_STORE }; enum log_entry_subtype { LOGGER_TEXT_ENTRY = 0, - LOGGER_EVICTION_ENTRY + LOGGER_EVICTION_ENTRY, + LOGGER_ITEM_GET_ENTRY, + LOGGER_ITEM_STORE_ENTRY }; enum logger_ret_type { @@ -39,6 +43,7 @@ typedef const struct { char *format; } entry_details; +/* log entry intermediary structures */ struct logentry_eviction { long long int exptime; uint32_t latime; @@ -47,6 +52,21 @@ struct logentry_eviction { char key[]; }; +struct logentry_item_get { + uint8_t was_found; + uint8_t nkey; + char key[]; +}; + +struct logentry_item_store { + int status; + int cmd; + uint8_t nkey; + char key[]; +}; + +/* end intermediary structures */ + typedef struct _logentry { enum log_entry_subtype event; uint16_t eflags; |