我正在运行以下命令并将标准输出存储到文本文件中。我需要在每行输出文件中添加 unix 时间戳,以确定每个操作的开始和结束时间。
$ ./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://172.28.128.5:27017 -p mongodb.database=ycsb > outputLoad.txt
和输出:
$ cat outputLoad.txt
mongo client connection created with mongodb://172.28.128.5:27017
[OVERALL], RunTime(ms), 65348.0
[OVERALL], Throughput(ops/sec), 1530.2687151863868
[CLEANUP], Operations, 1.0
[CLEANUP], AverageLatency(us), 9732.0
[CLEANUP], MinLatency(us), 9728.0
[CLEANUP], MaxLatency(us), 9735.0
[CLEANUP], 95thPercentileLatency(us), 9735.0
[CLEANUP], 99thPercentileLatency(us), 9735.0
[INSERT], Operations, 100000.0
[INSERT], AverageLatency(us), 634.39211
[INSERT], MinLatency(us), 83.0
[INSERT], MaxLatency(us), 434175.0
[INSERT], 95thPercentileLatency(us), 769.0
[INSERT], 99thPercentileLatency(us), 3417.0
[INSERT], Return=0, 100000
谢谢!
正如@mschuett 提到的,刚刚将 %s 添加到命令中,如下所示:
和输出: