thejmazz / jmazz.me

3 stars 2 forks source link

make: Metrics #1

Open sjackman opened 8 years ago

sjackman commented 8 years ago

I use the zsh REPORTTIME feature to collect run time and memory usage metrics with make. It reports the time of each command, and even each separate command within a pipe. Add the following lines to your Makefile.

# Report run time and memory usage
export SHELL=zsh -opipefail
export REPORTTIME=1
export TIMEFMT=%J  %U user %S system %P cpu %*E total %M MB

Note that adding-opipefail is unrelated to the metric reporting, but is a very good idea to catch errors in pipes of commands.

thejmazz commented 8 years ago

Cool! Thanks Sean!

My blog should be set up soon and perhaps this could be added as a comment.

BTW, curious, how did you come across the article?

sjackman commented 8 years ago

Twitter: https://twitter.com/bioinformAnt/status/757568330052034565

thejmazz commented 8 years ago

Aha awesome. cheers. I gotta get blog up asap so I can get metrics on visits..