I'm looking for a tool similar to pv which is producing machine readable output. I can't believe that nobody did it before.

I looked at the manpages of pv, pipemeter, dd and cpipe, but all these tools seem to format their output in a human-readable way.

Right now I'm considering modifying pipemeter and adding a flag to disable the formatbytes function but I would prefer some solution that that does not require development tools.

For example a perl solution would be acceptable, if it does not slow down the pipe. Unfortunately my perl skills are limited and so is my experience with pipes (from a developer perspective).

The reason why I want this is so I can create benchmarks which produce log files which can than be transferred to a central collecting unit where they will be parsed and stored in a database.

  • strace -tt -s0 -e write cat? – Stéphane Chazelas Feb 6 '15 at 16:59
  • @StéphaneChazelas thanks for the input - i tried that, but it seems like this shows all calls to write and no speed information... And way to much information. Testing the 40GBit Line would fill up the hard drive in not time :) Is there a way to tell strace to do a summary in the end? – Florian Fida Feb 6 '15 at 17:22
  • hint , the splice(2) system call moves data from file descriptors without copy . if we want to minimal the performance overhead in the pipe , use splice . – 把友情留在无盐 Feb 6 '15 at 17:25
  • besides noticing wc(1) output is machine readable , but we still want a clock . some shells come with a time builtin , that can be tuned to print plain seconds . – 把友情留在无盐 Feb 6 '15 at 17:29
  • and why not parse output of dd(1) ? just delimetre this third line into fields . "2 bytes (2 B) copied, 1.00000 s, 0.0 kB/s" – 把友情留在无盐 Feb 6 '15 at 17:33

It may be old, but you owe it to yourself to read Larry McVoy's LMbench papers, and read the source. Yes, the papers are 20 years old, but they're still pretty interesting. McVoy and Staelin seem like the only folks that bothered to put together microbenchmarks that are portably accurate.

The source code includes bw_pipe.c, which purportedly measures pipe bandwidth, and lat_pipe.c, which is supposed to measure pipe latency, so that may at least give you an idea of what to measure, and how to measure it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.