scylladb / scylla-bench

43 stars 36 forks source link

Option to print headers #69

Open pveentjer opened 3 years ago

pveentjer commented 3 years ago

When running a test for a long period, it becomes unclear what the columns mean:

  17s   71242   71242      0 2.7ms  1.8ms  1.3ms  1.1ms  1ms    918µs  897µs  
  18s   71191   71191      0 2.4ms  1.9ms  1.3ms  1.1ms  1ms    918µs  898µs  
  19s   71265   71265      0 2.4ms  1.7ms  1.2ms  1.1ms  1ms    918µs  897µs  
  20s   71153   71153      0 2.3ms  1.8ms  1.3ms  1.1ms  1ms    918µs  898µs  
  21s   70867   70867      0 2.3ms  1.8ms  1.3ms  1.1ms  1ms    918µs  902µs  
  22s   69379   69379      0 10ms   6.9ms  1.6ms  1.1ms  1ms    918µs  921µs  
  23s   69655   69655      0 8.9ms  5.9ms  1.6ms  1.1ms  1ms    918µs  918µs  
  24s   69595   69595      0 9.2ms  6.3ms  1.7ms  1.1ms  1ms    918µs  919µs  
  25s   69125   69125      0 10ms   6.5ms  1.9ms  1.1ms  1ms    918µs  925µs  
  26s   69779   69779      0 14ms   6.3ms  1.6ms  1.1ms  1ms    918µs  916µs  
  27s   70166   70166      0 9ms    5.7ms  1.4ms  1.1ms  1ms    918µs  911µs  

If e.g. every 10/20 seconds the header was printed, it will be easier to figure out what the meaning is of a column.

nyh commented 3 years ago

Good idea. doing this was a common tradition in Unix tools.

It shouldn't be about the amount of seconds, but about the lines of output. For example, vmstat 1 prints a line of output every second, and re-prints the headers ever 25 lines - where 25 is assumed to be a useful terminal-window height.

As far as I can tell, vmstat has this number "25" hard-coded. But an even better approach is to figure out the terminal height. For an application that doesn't need to deal with being resized, the easiest thing is just use use the LINES environment variable - which all modern shells set.