#include "clients/generator.h"
+#define KEY_BYTES 20
+
/* Use this for string generation */
static const char ALPHANUMERICS[]=
"0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz";
for (uint64_t x= 0; x < number_of; x++)
{
- pairs[x].key= (char *)calloc(100, sizeof(char));
+ pairs[x].key= (char *)calloc(KEY_BYTES, sizeof(char));
if (pairs[x].key == NULL)
goto error;
- get_random_string(pairs[x].key, 100);
- pairs[x].key_length= 100;
+ get_random_string(pairs[x].key, KEY_BYTES);
+ pairs[x].key_length= KEY_BYTES;
if (value_length)
{
#define DEFAULT_EXECUTE_NUMBER 10000
#define DEFAULT_CONCURRENCY 1
+#define VALUE_BYTES 4096
+
#define PROGRAM_NAME "memslap"
#define PROGRAM_DESCRIPTION "Generates a load against a memcached custer of servers."
if (opt_test == SET_TEST)
{
- context->execute_pairs= pairs_generate(opt_execute_number, 400);
+ context->execute_pairs= pairs_generate(opt_execute_number, VALUE_BYTES);
context->execute_number= opt_execute_number;
}
break;
case OPT_DEBUG: /* --debug or -d */
- opt_verbose = OPT_DEBUG;
+ opt_verbose= OPT_DEBUG;
break;
case OPT_VERSION: /* --version or -V */
/* We always used non-blocking IO for load since it is faster */
memcached_behavior_set(memc_clone, MEMCACHED_BEHAVIOR_NO_BLOCK, 0);
- pairs_st *pairs= pairs_generate(number_of, 400);
+ pairs_st *pairs= pairs_generate(number_of, VALUE_BYTES);
*actual_loaded= execute_set(memc_clone, pairs, number_of);
memcached_free(memc_clone);