@@ -94,6 +94,8 @@ int64_t flag_filesize_mb = 4 << 10;
94
94
int32_t flag_threads = 1 ;
95
95
int64_t flag_fileage_sec = 60 ;
96
96
int64_t flag_blockage_sec = 10 ;
97
+ int64_t flag_stats_blocks = 100 ;
98
+ int64_t flag_stats_sec = 60 ;
97
99
uint64_t flag_blocksize_kb = 1024 ;
98
100
uint16_t flag_fanout_type =
99
101
// Use rollover as the default if it's available.
@@ -191,6 +193,12 @@ int ParseOptions(int key, char* arg, struct argp_state* state) {
191
193
case 321 :
192
194
flag_promisc = false ;
193
195
break ;
196
+ case 322 :
197
+ flag_stats_blocks = atoi (arg);
198
+ break ;
199
+ case 323 :
200
+ flag_stats_sec = atoi (arg);
201
+ break ;
194
202
}
195
203
return 0 ;
196
204
}
@@ -233,6 +241,8 @@ void ParseOptions(int argc, char** argv) {
233
241
{" blockage_sec" , 319 , n, 0 , " A block is written at least every N secs" },
234
242
{" blocksize_kb" , 320 , n, 0 , " Size of a block, in KB" },
235
243
{" no_promisc" , 321 , 0 , 0 , " Don't set promiscuous mode" },
244
+ {" stats_blocks" , 322 , n, 0 , " Size block stats will be displayed, requires verbose, default 100, 0 disables" },
245
+ {" stats_sec" , 323 , n, 0 , " Seconds stats will be displayed, requires verbose, default 60, 0 disables" },
236
246
{0 },
237
247
};
238
248
struct argp argp = {options, &ParseOptions};
@@ -513,8 +523,9 @@ void RunThread(int thread, st::ProducerConsumerQueue* write_index,
513
523
block_offset++;
514
524
515
525
// Log stats every 100 blocks or at least 1/minute.
516
- if (blocks % 100 == 0 ||
517
- lastlog < current_micros - 60 * kNumMicrosPerSecond ) {
526
+ if ( (flag_stats_blocks != 0 && blocks % flag_stats_blocks == 0 ) ||
527
+ (flag_stats_sec != 0 &&
528
+ lastlog < current_micros - flag_stats_sec * kNumMicrosPerSecond ) ) {
518
529
lastlog = current_micros;
519
530
double duration = (current_micros - start) * 1.0 / kNumMicrosPerSecond ;
520
531
Stats stats;
0 commit comments