Skip to main content

Name

gauge_cache_manip

Synopsis

#include "hooks/core/gauge_cache.h"

| void **gauge_cache_manip** ( | closure, |   | |   | cache, |   | |   | key, |   | |   | keylen, |   | |   | addend, |   | |   | expiry_time, |   | |   | maxitems, |   | |   | replicated); |   |

void * <var class="pdparam">closure</var>; const char * <var class="pdparam">cache</var>; const char * <var class="pdparam">key</var>; int <var class="pdparam">keylen</var>; int <var class="pdparam">addend</var>; uint64_t <var class="pdparam">expiry_time</var>; int <var class="pdparam">maxitems</var>; int <var class="pdparam">replicated</var>;

| int **has_core_gauge_cache_manip_hook** ( | ); |   |

| void **register_core_gauge_cache_manip_hook_first** ( | hook, |   | |   | closure); |   |

ec_hook_core_gauge_cache_manip_func_t <var class="pdparam">hook</var>; void *<var class="pdparam">closure</var>;

| void **register_core_gauge_cache_manip_hook_last** ( | hook, |   | |   | closure); |   |

ec_hook_core_gauge_cache_manip_func_t <var class="pdparam">hook</var>; void *<var class="pdparam">closure</var>;

| void **call_core_gauge_cache_manip_hook** ( | cache, |   | |   | key, |   | |   | keylen, |   | |   | addend, |   | |   | expiry_time, |   | |   | maxitems, |   | |   | replicated); |   |

const char * <var class="pdparam">cache</var>; const char * <var class="pdparam">key</var>; int <var class="pdparam">keylen</var>; int <var class="pdparam">addend</var>; uint64_t <var class="pdparam">expiry_time</var>; int <var class="pdparam">maxitems</var>; int <var class="pdparam">replicated</var>;

Description

This hook is called when the sieve command "ec_gauge_cache_inc" or "ec_gauge_cache_dec" is invoked. The arguments are the cache name and the key name, the addend (1 for an increment or -1 for a decrement), and an expiry time. The expiry time specifies the unix time when the element expires. The maxitems is the max number of elements in the cache.

Was this page helpful?