diff --git a/src/keydb-diagnostic-tool.cpp b/src/keydb-diagnostic-tool.cpp index b782b6a91..163311646 100644 --- a/src/keydb-diagnostic-tool.cpp +++ b/src/keydb-diagnostic-tool.cpp @@ -706,12 +706,13 @@ int parseOptions(int argc, const char **argv) { if (!strcmp(argv[i],"-c") || !strcmp(argv[i],"--clients")) { if (lastarg) goto invalid; config.numclients = atoi(argv[++i]); - } else if (!strcmp(argv[i],"-k")) { - if (lastarg) goto invalid; - config.keepalive = atoi(argv[++i]); - } else if (!strcmp(argv[i],"--ms")) { + } else if (!strcmp(argv[i],"--time")) { if (lastarg) goto invalid; config.period_ms = atoi(argv[++i]); + if (config.period_ms <= 0) { + printf("Warning: Invalid value for thread time. Defaulting to 5000ms.\n"); + config.period_ms = 5000; + } } else if (!strcmp(argv[i],"-h") || !strcmp(argv[i],"--host")) { if (lastarg) goto invalid; config.hostip = strdup(argv[++i]); @@ -770,7 +771,7 @@ int parseOptions(int argc, const char **argv) { if (lastarg) goto invalid; config.max_threads = atoi(argv[++i]); if (config.max_threads > MAX_THREADS) { - printf("WARNING: too many threads, limiting threads to %d.\n", MAX_THREADS); + printf("Warning: Too many threads, limiting threads to %d.\n", MAX_THREADS); config.max_threads = MAX_THREADS; } else if (config.max_threads <= 0) { printf("Warning: Invalid value for max threads. Defaulting to %d.\n", MAX_THREADS); @@ -800,17 +801,16 @@ invalid: usage: printf( "Usage: keydb-benchmark [-h ] [-p ] [-c ] [-n ] [-k ]\n\n" -" -h Server hostname (default 127.0.0.1)\n" -" -p Server port (default 6379)\n" +" -h, --host Server hostname (default 127.0.0.1)\n" +" -p, --port Server port (default 6379)\n" " -s Server socket (overrides host and port)\n" -" --ms Time between spinning up new client threads\n" +" --time