MySQL  8.0.18
Source Code Documentation
topkeys.c File Reference
#include <sys/types.h>
#include <stdlib.h>
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include <pthread.h>
#include <memcached/genhash.h>
#include "topkeys.h"

Classes

struct  tk_context
 

Macros

#define TK_FMT(name)   #name "=%d,"
 
#define TK_ARGS(name)   item->name,
 

Functions

static topkey_item_ttopkey_item_init (const void *key, int nkey, rel_time_t ctime)
 
static size_t topkey_item_size (const topkey_item_t *item)
 
static topkey_item_ttopkeys_tail (topkeys_t *tk)
 
static int my_hash_eq (const void *k1, size_t nkey1, const void *k2, size_t nkey2)
 
topkeys_ttopkeys_init (int max_keys)
 
void topkeys_free (topkeys_t *tk)
 
static void dlist_remove (dlist_t *list)
 
static void dlist_insert_after (dlist_t *list, dlist_t *new)
 
static void dlist_iter (dlist_t *list, void(*iterfunc)(dlist_t *item, void *arg), void *arg)
 
static void topkeys_item_delete (topkeys_t *tk, topkey_item_t *item)
 
topkey_item_ttopkeys_item_get_or_create (topkeys_t *tk, const void *key, size_t nkey, const rel_time_t ctime)
 
static void append_stat (const void *cookie, const char *name, size_t namelen, const char *key, size_t nkey, int value, ADD_STAT add_stats)
 
static void tk_iterfunc (dlist_t *list, void *arg)
 
ENGINE_ERROR_CODE topkeys_stats (topkeys_t *tk, const void *cookie, const rel_time_t current_time, ADD_STAT add_stat)
 

Macro Definition Documentation

◆ TK_ARGS

#define TK_ARGS (   name)    item->name,

◆ TK_FMT

#define TK_FMT (   name)    #name "=%d,"

Function Documentation

◆ append_stat()

static void append_stat ( const void *  cookie,
const char *  name,
size_t  namelen,
const char *  key,
size_t  nkey,
int  value,
ADD_STAT  add_stats 
)
inlinestatic

◆ dlist_insert_after()

static void dlist_insert_after ( dlist_t list,
dlist_t new 
)
inlinestatic

◆ dlist_iter()

static void dlist_iter ( dlist_t list,
void(*)(dlist_t *item, void *arg)  iterfunc,
void *  arg 
)
inlinestatic

◆ dlist_remove()

static void dlist_remove ( dlist_t list)
inlinestatic

◆ my_hash_eq()

static int my_hash_eq ( const void *  k1,
size_t  nkey1,
const void *  k2,
size_t  nkey2 
)
static

◆ tk_iterfunc()

static void tk_iterfunc ( dlist_t list,
void *  arg 
)
static

◆ topkey_item_init()

static topkey_item_t* topkey_item_init ( const void *  key,
int  nkey,
rel_time_t  ctime 
)
static

◆ topkey_item_size()

static size_t topkey_item_size ( const topkey_item_t item)
inlinestatic

◆ topkeys_free()

void topkeys_free ( topkeys_t tk)

◆ topkeys_init()

topkeys_t* topkeys_init ( int  max_keys)

◆ topkeys_item_delete()

static void topkeys_item_delete ( topkeys_t tk,
topkey_item_t item 
)
inlinestatic

◆ topkeys_item_get_or_create()

topkey_item_t* topkeys_item_get_or_create ( topkeys_t tk,
const void *  key,
size_t  nkey,
const rel_time_t  ctime 
)

◆ topkeys_stats()

ENGINE_ERROR_CODE topkeys_stats ( topkeys_t tk,
const void *  cookie,
const rel_time_t  current_time,
ADD_STAT  add_stat 
)

◆ topkeys_tail()

static topkey_item_t* topkeys_tail ( topkeys_t tk)
inlinestatic