gradle-circle-style icon indicating copy to clipboard operation
gradle-circle-style copied to clipboard

[FR] Automatically capture reports from ./gradlew --profile on CI

Open iamdanfox opened this issue 6 years ago • 5 comments

Running ./gradlew --profile <task> locally is a super helpful way to diagnose slowness, but it seems to always output the nice HTML report to the build/reports/profile directory.

I'd like to add --profile to all my tasks on CI because profiling is pretty cheap and it's interesting to be able to click through and see whether there's low-hanging fruit. Currently, I'd need to add a bunch of nasty lines of bash to copy these reports into the $CIRCLE_ARTIFACTS directory.

As an alternative, what do you think about making this gradle plugin detect the --profile flag and add it's own version of the ReportGeneratingProfileListener which writes to the $CIRCLE_ARTIFACTS directory?

iamdanfox avatar Jun 28 '18 13:06 iamdanfox

Sounds cheap and smart. Definitely within the scope of this plugin. Only problem is develop is stuck on a blocked feature. Base your PR off the 1.x branch and I'll fix that independently.

alicederyn avatar Jun 28 '18 15:06 alicederyn

Cool, can't promise a PR soon but glad you think this repo could be a good home for this feature :)

iamdanfox avatar Jun 28 '18 15:06 iamdanfox

I would expect you to be able to configure the target directory with a single line of Gradle by the way, definitely check to see if that's possible before sinking time into the listener route (assuming you haven't already search and hit a blank).

alicederyn avatar Jun 28 '18 15:06 alicederyn

Yeah I was really hoping there would be a one-liner to do that too, but my googling skills are apparently not good enough (and as far as I can tell, the build/reports/profile directory isn't configurable)

iamdanfox avatar Jun 28 '18 15:06 iamdanfox

You just catapulted past the bar for becoming an admin on this repository, holy cow.

alicederyn avatar Jun 28 '18 15:06 alicederyn