Add --skip option: By default, mutilate tries to maintain a long-term QPS average by issuing requests as quickly as possible until it catches up with where it 'ought' to be. If you give the --skip option, it will instead just skip sending requests that are already late.
This commit is contained in:
parent
a8168f28dc
commit
7ca3e57c6d
@ -6,6 +6,7 @@ class AgentStats {
|
|||||||
public:
|
public:
|
||||||
uint64_t rx_bytes, tx_bytes;
|
uint64_t rx_bytes, tx_bytes;
|
||||||
uint64_t gets, sets, get_misses;
|
uint64_t gets, sets, get_misses;
|
||||||
|
uint64_t skips;
|
||||||
|
|
||||||
double start, stop;
|
double start, stop;
|
||||||
};
|
};
|
||||||
|
@ -256,8 +256,17 @@ void Connection::drive_write_machine(double now) {
|
|||||||
issue_something(now);
|
issue_something(now);
|
||||||
stats.log_op(op_queue.size());
|
stats.log_op(op_queue.size());
|
||||||
|
|
||||||
|
if (args.skip_given && op_queue.size() >= (size_t) options.depth) {
|
||||||
next_time += iagen->generate();
|
next_time += iagen->generate();
|
||||||
|
|
||||||
|
while (next_time < now) {
|
||||||
|
stats.skips++;
|
||||||
|
next_time += iagen->generate();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
next_time += iagen->generate();
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WAITING_FOR_TIME:
|
case WAITING_FOR_TIME:
|
||||||
|
@ -29,7 +29,7 @@ class ConnectionStats {
|
|||||||
get_sampler(200), set_sampler(200), op_sampler(100),
|
get_sampler(200), set_sampler(200), op_sampler(100),
|
||||||
#endif
|
#endif
|
||||||
rx_bytes(0), tx_bytes(0), gets(0), sets(0),
|
rx_bytes(0), tx_bytes(0), gets(0), sets(0),
|
||||||
get_misses(0), sampling(_sampling) {}
|
get_misses(0), skips(0), sampling(_sampling) {}
|
||||||
|
|
||||||
#ifdef USE_ADAPTIVE_SAMPLER
|
#ifdef USE_ADAPTIVE_SAMPLER
|
||||||
AdaptiveSampler<Operation> get_sampler;
|
AdaptiveSampler<Operation> get_sampler;
|
||||||
@ -47,6 +47,7 @@ class ConnectionStats {
|
|||||||
|
|
||||||
uint64_t rx_bytes, tx_bytes;
|
uint64_t rx_bytes, tx_bytes;
|
||||||
uint64_t gets, sets, get_misses;
|
uint64_t gets, sets, get_misses;
|
||||||
|
uint64_t skips;
|
||||||
|
|
||||||
double start, stop;
|
double start, stop;
|
||||||
|
|
||||||
@ -103,6 +104,7 @@ class ConnectionStats {
|
|||||||
gets += cs.gets;
|
gets += cs.gets;
|
||||||
sets += cs.sets;
|
sets += cs.sets;
|
||||||
get_misses += cs.get_misses;
|
get_misses += cs.get_misses;
|
||||||
|
skips += cs.skips;
|
||||||
|
|
||||||
start = cs.start;
|
start = cs.start;
|
||||||
stop = cs.stop;
|
stop = cs.stop;
|
||||||
@ -114,6 +116,7 @@ class ConnectionStats {
|
|||||||
gets += as.gets;
|
gets += as.gets;
|
||||||
sets += as.sets;
|
sets += as.sets;
|
||||||
get_misses += as.get_misses;
|
get_misses += as.get_misses;
|
||||||
|
skips += as.skips;
|
||||||
|
|
||||||
start = as.start;
|
start = as.start;
|
||||||
stop = as.stop;
|
stop = as.stop;
|
||||||
|
@ -40,17 +40,20 @@ By default, each thread connects to every server."
|
|||||||
option "iadist" i "Inter-arrival distribution (distribution). Note: \
|
option "iadist" i "Inter-arrival distribution (distribution). Note: \
|
||||||
The distribution will automatically be adjusted to match the QPS given \
|
The distribution will automatically be adjusted to match the QPS given \
|
||||||
by --qps." string default="exponential"
|
by --qps." string default="exponential"
|
||||||
|
option "skip" S "Skip transmissions if previous requests are late. This \
|
||||||
|
harms the long-term QPS average, but reduces spikes in QPS after \
|
||||||
|
long latency requests."
|
||||||
|
|
||||||
option "noload" - "Skip database loading."
|
option "noload" - "Skip database loading."
|
||||||
option "loadonly" - "Load database and then exit."
|
option "loadonly" - "Load database and then exit."
|
||||||
|
|
||||||
option "blocking" B "Use blocking epoll(). May increase latency."
|
option "blocking" B "Use blocking epoll(). May increase latency."
|
||||||
option "no_nodelay" D "Don't use TCP_NODELAY."
|
option "no_nodelay" - "Don't use TCP_NODELAY."
|
||||||
|
|
||||||
option "warmup" w "Warmup time before starting measurement." int
|
option "warmup" w "Warmup time before starting measurement." int
|
||||||
option "wait" W "Time to wait after startup to start measurement." int
|
option "wait" W "Time to wait after startup to start measurement." int
|
||||||
|
|
||||||
option "search" S "Search for the QPS where N-order statistic < Xus. \
|
option "search" - "Search for the QPS where N-order statistic < Xus. \
|
||||||
(i.e. --search 95:1000 means find the QPS where 95% of requests are \
|
(i.e. --search 95:1000 means find the QPS where 95% of requests are \
|
||||||
faster than 1000us)." string typestr="N:X"
|
faster than 1000us)." string typestr="N:X"
|
||||||
option "scan" - "Scan latency across QPS rates from min to max."
|
option "scan" - "Scan latency across QPS rates from min to max."
|
||||||
@ -65,7 +68,7 @@ option "measure_connections" C "Master client connections per server, \
|
|||||||
overrides --connections." int
|
overrides --connections." int
|
||||||
option "measure_qps" Q "Explicitly set master client QPS, \
|
option "measure_qps" Q "Explicitly set master client QPS, \
|
||||||
spread across threads and connections." int
|
spread across threads and connections." int
|
||||||
option "measure_depth" - "Set master client depth." int
|
option "measure_depth" D "Set master client connection depth." int
|
||||||
|
|
||||||
text "
|
text "
|
||||||
The --measure_* options aid in taking latency measurements of the
|
The --measure_* options aid in taking latency measurements of the
|
||||||
|
@ -210,6 +210,7 @@ void agent() {
|
|||||||
as.get_misses = stats.get_misses;
|
as.get_misses = stats.get_misses;
|
||||||
as.start = stats.start;
|
as.start = stats.start;
|
||||||
as.stop = stats.stop;
|
as.stop = stats.stop;
|
||||||
|
as.skips = stats.skips;
|
||||||
|
|
||||||
string req = s_recv(socket);
|
string req = s_recv(socket);
|
||||||
// V("req = %s", req.c_str());
|
// V("req = %s", req.c_str());
|
||||||
@ -570,16 +571,18 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
int total = stats.gets + stats.sets;
|
int total = stats.gets + stats.sets;
|
||||||
|
|
||||||
printf("\nTotal QPS = %.1f (%d / %.1fs)\n\n",
|
printf("\nTotal QPS = %.1f (%d / %.1fs)\n",
|
||||||
total / (stats.stop - stats.start),
|
total / (stats.stop - stats.start),
|
||||||
total, stats.stop - stats.start);
|
total, stats.stop - stats.start);
|
||||||
|
|
||||||
if (args.search_given && peak_qps > 0.0)
|
if (args.search_given && peak_qps > 0.0)
|
||||||
printf("Peak QPS = %.1f\n\n", peak_qps);
|
printf("Peak QPS = %.1f\n\n", peak_qps);
|
||||||
|
|
||||||
printf("Misses = %" PRIu64 " (%.1f%%)\n\n", stats.get_misses,
|
printf("Misses = %" PRIu64 " (%.1f%%)\n", stats.get_misses,
|
||||||
(double) stats.get_misses/stats.gets*100);
|
(double) stats.get_misses/stats.gets*100);
|
||||||
|
|
||||||
|
printf("Skipped TXs = %" PRIu64 "\n\n", stats.skips);
|
||||||
|
|
||||||
printf("RX %10" PRIu64 " bytes : %6.1f MB/s\n",
|
printf("RX %10" PRIu64 " bytes : %6.1f MB/s\n",
|
||||||
stats.rx_bytes,
|
stats.rx_bytes,
|
||||||
(double) stats.rx_bytes / 1024 / 1024 / (stats.stop - stats.start));
|
(double) stats.rx_bytes / 1024 / 1024 / (stats.stop - stats.start));
|
||||||
|
Loading…
Reference in New Issue
Block a user