1

I'm running the following command and storing the stdout into a text file. I need to add unix timestamp to each line output file to figure out start and end time of each operation.

$ ./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://172.28.128.5:27017 -p mongodb.database=ycsb > outputLoad.txt

And the output:

$ 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

Thanks!

4

1 Answer 1

0

As @mschuett mentioned just added %s to the command as follow:

$ ./bin/ycsb load mongodb -s -P workloads/workloada -p mongodb.url=mongodb://172.28.128.5:27017 -p mongodb.database=ycsb | ts [%s] > outpuLoad.txt

And the output:

$ cat outputLoad.txt 

[1443106507] [INSERT], Operations, 10000.0
[1443106507] [INSERT], AverageLatency(us), 1114.4243
[1443106507] [INSERT], MinLatency(us), 379.0
[1443106507] [INSERT], MaxLatency(us), 550399.0
[1443106507] [INSERT], 95thPercentileLatency(us), 1288.0
[1443106507] [INSERT], 99thPercentileLatency(us), 8679.0
[1443106507] [INSERT], Return=0, 10000

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .