Server IP : 172.67.216.182 / Your IP : 162.158.170.47 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/plugin/innodb_memcached/daemon_memcached/daemon/ |
Upload File : |
#ifndef TOPKEYS_H #define TOPKEYS_H 1 #include <memcached/engine.h> #include <memcached/genhash.h> /* A list of operations for which we have int stats */ #define TK_OPS(C) C(get_hits) C(get_misses) C(cmd_set) C(incr_hits) \ C(incr_misses) C(decr_hits) C(decr_misses) \ C(delete_hits) C(delete_misses) C(evictions) \ C(cas_hits) C(cas_badval) C(cas_misses) #define TK_MAX_VAL_LEN 250 /* Update the correct stat for a given operation */ #define TK(tk, op, key, nkey, ctime) { \ if (tk) { \ assert(key); \ assert(nkey > 0); \ pthread_mutex_lock(&tk->mutex); \ topkey_item_t *tmp = topkeys_item_get_or_create( \ (tk), (key), (nkey), (ctime)); \ tmp->op++; \ pthread_mutex_unlock(&tk->mutex); \ } \ } typedef struct dlist { struct dlist *next; struct dlist *prev; } dlist_t; typedef struct topkey_item { dlist_t list; /* Must be at the beginning because we downcast! */ int nkey; rel_time_t ctime, atime; /* Time this item was created/last accessed */ #define TK_CUR(name) int name; TK_OPS(TK_CUR) #undef TK_CUR char key[]; /* A variable length array in the struct itself */ } topkey_item_t; typedef struct topkeys { dlist_t list; pthread_mutex_t mutex; genhash_t *hash; int nkeys; int max_keys; } topkeys_t; topkeys_t *topkeys_init(int max_keys); void topkeys_free(topkeys_t *topkeys); topkey_item_t *topkeys_item_get_or_create(topkeys_t *tk, const void *key, size_t nkey, const rel_time_t ctime); ENGINE_ERROR_CODE topkeys_stats(topkeys_t *tk, const void *cookie, const rel_time_t current_time, ADD_STAT add_stat); #endif