Ale*_*x B 39 command-line performance io pipe
有一个 shell 命令可以让您测量数据通过它的速度,因此您可以测量管道中命令的输出速度。所以而不是:
$ somecommand | anothercommand
Run Code Online (Sandbox Code Playgroud)
您可以执行以下操作:
$ somecommand | ??? | anothercommand
Run Code Online (Sandbox Code Playgroud)
我认为,吞吐量统计信息(字节/秒)会打印到 stderr。但我终生无法记住那个命令是什么。
hob*_*ave 21
您需要一个名为cpipe的实用程序。
用法:
tar cCf / - usr | cpipe -vr -vw -vt > /dev/null
Run Code Online (Sandbox Code Playgroud)
输出:
...
in: 19.541ms at 6.4MB/s ( 4.7MB/s avg) 2.0MB
out: 0.004ms at 30.5GB/s ( 27.1GB/s avg) 2.0MB
thru: 19.865ms at 6.3MB/s ( 4.6MB/s avg) 2.0MB
...
Run Code Online (Sandbox Code Playgroud)