uint64_t total_get_cmds= 0, total_get_hits= 0;
uint32_t server_count, x;
memcached_analysis_st *result;
-
+
*error= MEMCACHED_SUCCESS;
server_count= memcached_server_count(memc);
result= (memcached_analysis_st*)calloc(memc->number_of_hosts,
return NULL;
}
- result->options.allocated= true;
result->root= memc;
for (x= 0; x < server_count; x++)
void memcached_analyze_free(memcached_analysis_st *ptr)
{
- if (ptr->options.allocated)
- free(ptr);
+ free(ptr);
}
* Use and distribution licensed under the BSD license. See
* the COPYING file in the parent directory for full text.
*
- * Summary: Change the behavior of the memcached connection.
+ * Summary: Generate a memcached_analysis_st
*
*/
struct memcached_analysis_st {
- struct {
- bool allocated:1;
- } options;
memcached_st *root;
uint32_t average_item_size;
uint32_t longest_uptime;
*
*/
-#include "common.h"
+#include "common.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
-/*
+/*
These functions provide data and function callback support
*/
-memcached_return_t memcached_callback_set(memcached_st *ptr,
- const memcached_callback_t flag,
+memcached_return_t memcached_callback_set(memcached_st *ptr,
+ const memcached_callback_t flag,
void *data)
{
switch (flag)
return MEMCACHED_SUCCESS;
}
-void *memcached_callback_get(memcached_st *ptr,
+void *memcached_callback_get(memcached_st *ptr,
const memcached_callback_t flag,
memcached_return_t *error)
{
#define SMALL_STRING_LEN 1024
#define HUGE_STRING_LEN 8196
-
-typedef enum {
- MEM_NO_BLOCK= (1 << 0),
- MEM_TCP_NODELAY= (1 << 1),
- MEM_REUSE_MEMORY= (1 << 2),
- MEM_USE_MD5= (1 << 3),
- /* 4 was once Ketama */
- MEM_USE_CRC= (1 << 5),
- MEM_USE_CACHE_LOOKUPS= (1 << 6),
- MEM_SUPPORT_CAS= (1 << 7),
- MEM_BUFFER_REQUESTS= (1 << 8),
- MEM_USE_SORT_HOSTS= (1 << 9),
- MEM_VERIFY_KEY= (1 << 10),
- /* 11 used for weighted ketama */
- MEM_KETAMA_WEIGHTED= (1 << 11),
- MEM_BINARY_PROTOCOL= (1 << 12),
- MEM_HASH_WITH_PREFIX_KEY= (1 << 13),
- MEM_NOREPLY= (1 << 14),
- MEM_USE_UDP= (1 << 15),
- MEM_AUTO_EJECT_HOSTS= (1 << 16),
- MEM_RANDOMIZE_REPLICA_READ= (1 << 17)
-} memcached_flags;
-
/* Hashing algo */
LIBMEMCACHED_LOCAL
void server_list_free(memcached_st *ptr, memcached_server_st *servers);
LIBMEMCACHED_LOCAL
-memcached_return_t memcached_key_test(const char * const *keys,
+memcached_return_t memcached_key_test(const char * const *keys,
const size_t *key_length,
size_t number_of_keys);