void options_parse(int argc, char *argv[]);
void conclusions_print(conclusions_st *conclusion);
void scheduler(memcached_server_st *servers, conclusions_st *conclusion);
void options_parse(int argc, char *argv[]);
void conclusions_print(conclusions_st *conclusion);
void scheduler(memcached_server_st *servers, conclusions_st *conclusion);
-pairs_st *load_createial_data(memcached_server_st *servers, unsigned int number_of,
- unsigned int *actual_loaded);
+pairs_st *load_create_data(memcached_st *memc, unsigned int number_of,
+ unsigned int *actual_loaded);
+void flush_all(memcached_st *memc);
static unsigned int opt_execute_number= 0;
static unsigned int opt_createial_load= 0;
static unsigned int opt_concurrency= 0;
static unsigned int opt_execute_number= 0;
static unsigned int opt_createial_load= 0;
static unsigned int opt_concurrency= 0;
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
struct timeval start_time, end_time;
pthread_t mainthread; /* Thread descriptor */
struct timeval start_time, end_time;
pthread_t mainthread; /* Thread descriptor */
pthread_attr_setdetachstate(&attr,
PTHREAD_CREATE_DETACHED);
pthread_attr_setdetachstate(&attr,
PTHREAD_CREATE_DETACHED);
- pairs= load_createial_data(servers, opt_createial_load, &actual_loaded);
+ pairs= load_create_data(memc, opt_createial_load, &actual_loaded);
+
+ /* We set this after we have loaded */
+ {
+ unsigned int value= 1;
+ if (opt_non_blocking_io)
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, &value);
+ if (opt_tcp_nodelay)
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, &value);
+ }
+
{"debug", no_argument, &opt_verbose, OPT_DEBUG},
{"execute-number", required_argument, NULL, OPT_SLAP_EXECUTE_NUMBER},
{"flag", no_argument, &opt_displayflag, OPT_FLAG},
{"debug", no_argument, &opt_verbose, OPT_DEBUG},
{"execute-number", required_argument, NULL, OPT_SLAP_EXECUTE_NUMBER},
{"flag", no_argument, &opt_displayflag, OPT_FLAG},
{"help", no_argument, NULL, OPT_HELP},
{"initial-load", required_argument, NULL, OPT_SLAP_INITIAL_LOAD}, /* Number to load initially */
{"non-blocking", no_argument, &opt_non_blocking_io, OPT_SLAP_NON_BLOCK},
{"servers", required_argument, NULL, OPT_SERVERS},
{"help", no_argument, NULL, OPT_HELP},
{"initial-load", required_argument, NULL, OPT_SLAP_INITIAL_LOAD}, /* Number to load initially */
{"non-blocking", no_argument, &opt_non_blocking_io, OPT_SLAP_NON_BLOCK},
{"servers", required_argument, NULL, OPT_SERVERS},
{"test", required_argument, NULL, OPT_SLAP_TEST},
{"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
{"version", no_argument, NULL, OPT_VERSION},
{"test", required_argument, NULL, OPT_SLAP_TEST},
{"verbose", no_argument, &opt_verbose, OPT_VERBOSE},
{"version", no_argument, NULL, OPT_VERSION},
- memc= memcached_create(NULL);
- if (opt_non_blocking_io)
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL );
-
- memcached_server_push(memc, context->servers);
+ memcached_flush(memc, 0);
+}
+
+pairs_st *load_create_data(memcached_st *memc, unsigned int number_of,
+ unsigned int *actual_loaded)
+{
+ memcached_st *clone;
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL );
- memcached_server_push(memc, servers);
+ memcached_behavior_set(clone, MEMCACHED_BEHAVIOR_NO_BLOCK, NULL );