@@ -41,6 +41,7 @@ ABSL_FLAG(uint64_t, seed, 42, "A seed for random data generation");
41
41
ABSL_FLAG (uint64_t , key_stddev, 0 ,
42
42
" Standard deviation for non-uniform distribution, 0 chooses"
43
43
" a default value of (max-min)/6" );
44
+ ABSL_FLAG (uint32_t , pipeline, 1 , " maximum number of pending requests per connection" );
44
45
ABSL_FLAG (string, ratio, " 1:10" , " Set:Get ratio" );
45
46
ABSL_FLAG (string, command, " " , " custom command with __key__ placeholder for keys" );
46
47
ABSL_FLAG (string, P, " " , " protocol can be empty (for RESP) or memcache_text" );
@@ -314,7 +315,10 @@ void Driver::Connect(unsigned index, const tcp::endpoint& ep) {
314
315
315
316
void Driver::Run (uint64_t * cycle_ns, CommandGenerator* cmd_gen) {
316
317
const int64_t start = absl::GetCurrentTimeNanos ();
318
+ unsigned pipeline = GetFlag (FLAGS_pipeline);
319
+
317
320
stats_.num_clients ++;
321
+
318
322
for (unsigned i = 0 ; i < num_reqs_; ++i) {
319
323
int64_t now = absl::GetCurrentTimeNanos ();
320
324
@@ -333,7 +337,7 @@ void Driver::Run(uint64_t* cycle_ns, CommandGenerator* cmd_gen) {
333
337
// Coordinated omission.
334
338
335
339
fb2::NoOpLock lk;
336
- cnd_.wait (lk, [this ] { return reqs_.empty () ; });
340
+ cnd_.wait (lk, [this , pipeline ] { return reqs_.size () < pipeline ; });
337
341
}
338
342
string cmd = cmd_gen->Next ();
339
343
0 commit comments