#define LIBMEMCACHED_VERSION_STRING "0.29"
struct memcached_analysis_st {
- uint64_t most_used_bytes;
- uint64_t least_remaining_bytes;
uint32_t average_item_size;
uint32_t longest_uptime;
uint32_t least_free_server;
uint32_t most_consumed_server;
uint32_t oldest_server;
double pool_hit_ratio;
+ uint64_t most_used_bytes;
+ uint64_t least_remaining_bytes;
};
struct memcached_stat_st {
+ uint32_t connection_structures;
+ uint32_t curr_connections;
+ uint32_t curr_items;
uint32_t pid;
- uint32_t uptime;
- uint32_t threads;
- uint32_t time;
uint32_t pointer_size;
- uint32_t rusage_user_seconds;
- uint32_t rusage_user_microseconds;
- uint32_t rusage_system_seconds;
uint32_t rusage_system_microseconds;
- uint32_t curr_items;
- uint32_t total_items;
- uint64_t limit_maxbytes;
- uint32_t curr_connections;
+ uint32_t rusage_system_seconds;
+ uint32_t rusage_user_microseconds;
+ uint32_t rusage_user_seconds;
+ uint32_t threads;
+ uint32_t time;
uint32_t total_connections;
- uint32_t connection_structures;
+ uint32_t total_items;
+ uint32_t uptime;
uint64_t bytes;
+ uint64_t bytes_read;
+ uint64_t bytes_written;
uint64_t cmd_get;
uint64_t cmd_set;
+ uint64_t evictions;
uint64_t get_hits;
uint64_t get_misses;
- uint64_t evictions;
- uint64_t bytes_read;
- uint64_t bytes_written;
+ uint64_t limit_maxbytes;
char version[MEMCACHED_VERSION_STRING_LENGTH];
};
struct memcached_st {
uint8_t purging;
bool is_allocated;
- memcached_server_st *hosts;
+ uint32_t continuum_points_counter;
+ int32_t snd_timeout;
+ int32_t rcv_timeout;
+ uint32_t server_failure_limit;
+ uint32_t io_msg_watermark;
+ uint32_t io_bytes_watermark;
+ uint32_t io_key_prefetch;
uint32_t number_of_hosts;
uint32_t cursor_server;
int cached_errno;
uint32_t flags;
- int send_size;
- int recv_size;
int32_t poll_timeout;
int32_t connect_timeout;
int32_t retry_timeout;
- memcached_result_st result;
+ uint32_t continuum_count;
memcached_hash hash;
- memcached_server_distribution distribution;
+ int send_size;
+ int recv_size;
+ memcached_server_st *hosts;
void *user_data;
- uint32_t continuum_count;
+ time_t next_distribution_rebuild;
+ size_t prefix_key_length;
+ memcached_result_st result;
+ memcached_server_distribution distribution;
memcached_continuum_item_st *continuum;
memcached_clone_func on_clone;
memcached_cleanup_func on_cleanup;
memcached_trigger_key get_key_failure;
memcached_trigger_delete_key delete_trigger;
char prefix_key[MEMCACHED_PREFIX_KEY_MAX_SIZE];
- size_t prefix_key_length;
memcached_hash hash_continuum;
- uint32_t continuum_points_counter;
- int32_t snd_timeout;
- int32_t rcv_timeout;
- uint32_t server_failure_limit;
- uint32_t io_msg_watermark;
- uint32_t io_bytes_watermark;
- uint32_t io_key_prefetch;
- time_t next_distribution_rebuild;
};
struct memcached_server_st {
bool is_allocated;
- char hostname[MEMCACHED_MAX_HOST_LENGTH];
+ bool sockaddr_inited;
+ uint16_t count;
+ unsigned int cursor_active;
unsigned int port;
- int fd;
int cached_errno;
- unsigned int cursor_active;
- char write_buffer[MEMCACHED_MAX_BUFFER];
- size_t write_buffer_offset;
- char read_buffer[MEMCACHED_MAX_BUFFER];
- size_t read_data_length;
- size_t read_buffer_length;
- char *read_ptr;
- bool sockaddr_inited;
- struct addrinfo *address_info;
- memcached_connection type;
+ int fd;
+ uint32_t io_bytes_sent; /* # bytes sent since last read */
+ uint32_t server_failure_counter;
+ uint32_t weight;
uint8_t major_version;
- uint8_t minor_version;
uint8_t micro_version;
- uint16_t count;
+ uint8_t minor_version;
+ memcached_connection type;
+ char *read_ptr;
+ size_t read_buffer_length;
+ size_t read_data_length;
+ size_t write_buffer_offset;
+ struct addrinfo *address_info;
time_t next_retry;
memcached_st *root;
uint64_t limit_maxbytes;
- uint32_t server_failure_counter;
- uint32_t io_bytes_sent; /* # bytes sent since last read */
- uint32_t weight;
+ char read_buffer[MEMCACHED_MAX_BUFFER];
+ char write_buffer[MEMCACHED_MAX_BUFFER];
+ char hostname[MEMCACHED_MAX_HOST_LENGTH];
};
#define memcached_server_count(A) (A)->number_of_hosts
uint32_t flags;
memcached_result_st results_obj;
memcached_result_st *results;
- ret=memcached_mget(memc, keys, lengths, 1);
+ ret= memcached_mget(memc, keys, lengths, 1);
assert(ret == MEMCACHED_SUCCESS);
- results=memcached_result_create(memc, &results_obj);
+ results= memcached_result_create(memc, &results_obj);
assert(results);
- results=memcached_fetch_result(memc, &results_obj, &ret);
+ results= memcached_fetch_result(memc, &results_obj, &ret);
assert(results);
assert(ret == MEMCACHED_SUCCESS);
uint64_t cas= memcached_result_cas(results);