Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Android build times #206

Closed
Sternbach-Software opened this issue Mar 29, 2022 · 3 comments
Closed

Tracking Android build times #206

Sternbach-Software opened this issue Mar 29, 2022 · 3 comments

Comments

@Sternbach-Software
Copy link

Sternbach-Software commented Mar 29, 2022

I am having a meeting with my boss about my efficiency, and I want to explain to him that in 300 hours of development, I have probably spent in total 100 hours waiting for Android studio to build, because I don't have a nice computer, and that he should buy my a nice one. I estimated that number assuming I build 15 times every hour and that each build takes 30 seconds, but some hours I don't build at all and some builds take 7 minutes. So, I wish WakaTime would track exactly how long it took me to build the app over time.

I don't know how to build Intellij plugins nor how to set up the environment, so I can't create a PR myself, but I found the relevant files in the Intellij sdk: 
GradleBuildState.java and GradleBuildListener.java. In the first file/class (GradleBuildState.java), there is a method named "subscribe" which takes the second file/class (GradleBuildListener.java) as a parameter. The second class is an interface with methods named buildExecutorCreated(), buildstarted () and buildFinished(). I assume the first one is called right when I click the build button, and is responsible for creating the Gradle daemon, and calls buildStarted() once the daemon is ready. I want to know how long it took from creating the daemon to finishing, because sometimes creating the daemon takes 20 second for me. All you would have to do is call System.nanoTime() in buildExecutorCreated() and in buildFinished() and the total time it took it, which is just the second call to System.nanoTime() minus the first call to System.nanoTime().

Please let me know what you think, as I would very possibly be willing to pay for premium if WakaTime had this simple feature to implement. Other than this, keep up the great work! Everything else is amazing!

This may also be helpful (e.g. may be necessary to create the plugin/listen to system build events, or may be helpful for tracking individual build tasks (there are a handful that go into every build and each has their own reason to blame if they are very long)): GradleBuildInvoker.java . Particularly of note are lines 405 through 539. 

@Sternbach-Software Sternbach-Software changed the title Adding Android build times Tracking Android build times Mar 29, 2022
@alanhamlett
Copy link
Member

Duplicate of #116 and fixed in release v14.0.0.

@Sternbach-Software
Copy link
Author

@alanhamlett Where do you view it on the dashboard?

@alanhamlett
Copy link
Member

alanhamlett commented Apr 19, 2022

We had to rollback the release because it depends on Java and broke the plugin for other jetbrains IDEs, like PyCharm. We'll add a conditional dependency to only enable tracking build times in supported IDEs, then do another release.

#235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants