|
| 1 | +# Adjust the program name to be able to identify the tool as memaslap |
| 2 | +# |
| 3 | +# memslap is another tool of libmemcached, that is not as useful |
| 4 | +# as it does not show stats nor accepts parameters such as threads or time. |
| 5 | +# |
| 6 | +--- clients/memaslap.c.orig 2014-02-09 11:52:42.000000000 +0000 |
| 7 | ++++ clients/memaslap.c 2022-06-03 09:57:33.085672134 +0000 |
| 8 | +@@ -1,5 +1,5 @@ |
| 9 | + /* |
| 10 | +- * memslap |
| 11 | ++ * memaslap |
| 12 | + * |
| 13 | + * (c) Copyright 2009, Schooner Information Technology, Inc. |
| 14 | + * All rights reserved. |
| 15 | +@@ -32,7 +32,7 @@ |
| 16 | + #include "ms_setting.h" |
| 17 | + #include "ms_thread.h" |
| 18 | + |
| 19 | +-#define PROGRAM_NAME "memslap" |
| 20 | ++#define PROGRAM_NAME "memaslap" |
| 21 | + #define PROGRAM_DESCRIPTION \ |
| 22 | + "Generates workload against memcached servers." |
| 23 | + |
| 24 | +@@ -111,7 +111,7 @@ |
| 25 | + static void ms_statistic_init(void); |
| 26 | + static void ms_stats_init(void); |
| 27 | + static void ms_print_statistics(int in_time); |
| 28 | +-static void ms_print_memslap_stats(struct timeval *start_time, |
| 29 | ++static void ms_print_memaslap_stats(struct timeval *start_time, |
| 30 | + struct timeval *end_time); |
| 31 | + static void ms_monitor_slap_mode(void); |
| 32 | + |
| 33 | +@@ -130,7 +130,7 @@ |
| 34 | + printf(" %s\n\n", description); |
| 35 | + printf( |
| 36 | + "Usage:\n" |
| 37 | +- " memslap -hV | -s servers [-F config_file] [-t time | -x exe_num] [...]\n\n" |
| 38 | ++ " memaslap -hV | -s servers [-F config_file] [-t time | -x exe_num] [...]\n\n" |
| 39 | + "Options:\n"); |
| 40 | + |
| 41 | + for (int x= 0; long_options[x].name; x++) |
| 42 | +@@ -146,13 +146,13 @@ |
| 43 | + |
| 44 | + printf( |
| 45 | + "\nExamples:\n" |
| 46 | +- " memslap -s 127.0.0.1:11211 -S 5s\n" |
| 47 | +- " memslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b\n" |
| 48 | +- " memslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2\n" |
| 49 | +- " memslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k\n" |
| 50 | +- " memslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40\n" |
| 51 | +- " memslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m\n" |
| 52 | +- " memslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2\n\n"); |
| 53 | ++ " memaslap -s 127.0.0.1:11211 -S 5s\n" |
| 54 | ++ " memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b\n" |
| 55 | ++ " memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2\n" |
| 56 | ++ " memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k\n" |
| 57 | ++ " memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40\n" |
| 58 | ++ " memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m\n" |
| 59 | ++ " memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2\n\n"); |
| 60 | + |
| 61 | + exit(0); |
| 62 | + } /* ms_help_command */ |
| 63 | +@@ -286,7 +286,7 @@ |
| 64 | + |
| 65 | + case OPT_UDP: |
| 66 | + return |
| 67 | +- "UDP support, default memslap uses TCP, TCP port and UDP port of\n" |
| 68 | ++ "UDP support, default memaslap uses TCP, TCP port and UDP port of\n" |
| 69 | + " server must be same."; |
| 70 | + |
| 71 | + case OPT_EXPIRE: |
| 72 | +@@ -708,8 +708,8 @@ |
| 73 | + } /* ms_print_statistics */ |
| 74 | + |
| 75 | + |
| 76 | +-/* used to print the states of memslap */ |
| 77 | +-static void ms_print_memslap_stats(struct timeval *start_time, |
| 78 | ++/* used to print the states of memaslap */ |
| 79 | ++static void ms_print_memaslap_stats(struct timeval *start_time, |
| 80 | + struct timeval *end_time) |
| 81 | + { |
| 82 | + char buf[1024]; |
| 83 | +@@ -803,7 +803,7 @@ |
| 84 | + |
| 85 | + fprintf(stdout, "%s", buf); |
| 86 | + fflush(stdout); |
| 87 | +-} /* ms_print_memslap_stats */ |
| 88 | ++} /* ms_print_memaslap_stats */ |
| 89 | + |
| 90 | + |
| 91 | + /* the loop of the main thread, wait the work threads to complete */ |
| 92 | +@@ -883,7 +883,7 @@ |
| 93 | + gettimeofday(&end_time, NULL); |
| 94 | + } |
| 95 | + |
| 96 | +- ms_print_memslap_stats(&start_time, &end_time); |
| 97 | ++ ms_print_memaslap_stats(&start_time, &end_time); |
| 98 | + } /* ms_monitor_slap_mode */ |
| 99 | + |
| 100 | + |
0 commit comments