static unsigned int opt_concurrency= 0;
static int opt_displayflag= 0;
static char *opt_servers= NULL;
static unsigned int opt_concurrency= 0;
static int opt_displayflag= 0;
static char *opt_servers= NULL;
test_type opt_test= SET_TEST;
int main(int argc, char *argv[])
test_type opt_test= SET_TEST;
int main(int argc, char *argv[])
+
+ /* We need to set udp behavior before adding servers to the client */
+ if (opt_udp_io)
+ {
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_USE_UDP, opt_udp_io);
+ unsigned int x= 0;
+ for(x= 0; x < servers[0].count; x++ )
+ servers[x].type= MEMCACHED_CONNECTION_UDP;
+ }
- context= (thread_context_st *)malloc(sizeof(thread_context_st));
- memset(context, 0, sizeof(thread_context_st));
+ context= (thread_context_st *)calloc(1, sizeof(thread_context_st));
- {
- struct timespec abstime;
-
- memset(&abstime, 0, sizeof(struct timespec));
- abstime.tv_sec= 1;
-
- pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
- }
+ pthread_cond_wait(&count_threshhold, &counter_mutex);
pthread_mutex_unlock(&counter_mutex);
gettimeofday(&end_time, NULL);
pthread_mutex_unlock(&counter_mutex);
gettimeofday(&end_time, NULL);
conclusion->load_time= timedif(end_time, start_time);
conclusion->read_time= timedif(end_time, start_time);
pairs_free(pairs);
conclusion->load_time= timedif(end_time, start_time);
conclusion->read_time= timedif(end_time, start_time);
pairs_free(pairs);
{"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},
+ {"binary", no_argument, NULL, OPT_BINARY},
+ {"udp", no_argument, NULL, OPT_UDP},
break;
case OPT_SLAP_CONCURRENCY:
opt_concurrency= strtol(optarg, (char **)NULL, 10);
break;
case OPT_SLAP_CONCURRENCY:
opt_concurrency= strtol(optarg, (char **)NULL, 10);
case OPT_SLAP_EXECUTE_NUMBER:
opt_execute_number= strtol(optarg, (char **)NULL, 10);
break;
case OPT_SLAP_EXECUTE_NUMBER:
opt_execute_number= strtol(optarg, (char **)NULL, 10);
break;