heroku-buildpack-nodejs icon indicating copy to clipboard operation
heroku-buildpack-nodejs copied to clipboard

Add timing information

Open kevinburkeshyp opened this issue 10 years ago • 8 comments

Our deploys are currently pretty slow (90 seconds to 3+ minutes) and I was wondering what I could do to speed it up. It would be useful if the buildpack echoed timing information for each step, so that it would be easy to compare across builds (instead of watching the console output and doing rough estimates in your head).

kevinburkeshyp avatar Jan 30 '15 20:01 kevinburkeshyp

:+1: I love this idea - it's something we've talked about doing lower in the build system (so all output would be timestamped). Until then, I think it'd be great to do it in the node buildpack.

hunterloftis avatar Jan 30 '15 21:01 hunterloftis

sweet. how do you imagine this looking? happy to help out, but if you're gonna do it go for it.

On Fri, Jan 30, 2015 at 1:25 PM, Hunter Loftis [email protected] wrote:

[image: :+1:] I love this idea - it's something we've talked about doing lower in the build system (so all output would be timestamped). Until then, I think it'd be great to do it in the node buildpack.

— Reply to this email directly or view it on GitHub https://github.com/heroku/heroku-buildpack-nodejs/issues/190#issuecomment-72272908 .

kevin

kevinburkeshyp avatar Jan 30 '15 22:01 kevinburkeshyp

Great question... I was thinking probably a function to pipe all output through (kind of like indent right now). That way we could change all output lines with minimal code changes, just a new pipe at the end.

hunterloftis avatar Jan 30 '15 22:01 hunterloftis

PRs happily accepted ;)

hunterloftis avatar Jan 30 '15 22:01 hunterloftis

That would give absolute timestamps, might be nice to have relative timestamps (this is how long this build step took) but that requires storing state. Maybe absolute is a good first pass

kevinburkeshyp avatar Feb 03 '15 07:02 kevinburkeshyp

Yeah I think absolute is a good v1, although the function could certainly manage a delta as well if you wanted. (UTC timestamp +5s) or something.

hunterloftis avatar Feb 04 '15 23:02 hunterloftis

+1

anonrig avatar Apr 21 '16 23:04 anonrig

I have created a buildpack that prefixes each line of the build logs with timestamps, and adds an overall duration to the end of each buildpack's compile step - if it's of any use? https://github.com/edmorley/heroku-buildpack-timestamps

We're been using it in production for 6 months now and it's helped us track down the slow parts of our multi-buildpack builds.

edmorley avatar Oct 16 '18 09:10 edmorley