-
Notifications
You must be signed in to change notification settings - Fork 620
Instrument Gradle build with metrics. #214
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
Conversation
Specifically we now report latency and success/failure of each individual Gradle task.
/retest |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review [1/2]
task.getExtensions().add(METRICS_ELAPSED_TIME, System.currentTimeMillis() - startTime); | ||
} | ||
|
||
private static long getElapsed(Task task) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We could either have an equivalent getStart() or write this inline as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw I did not add it because getStart()
is needed only in recordElapsed()
which is a pretty simple function, otoh getElapsed()
is used in a graph traversal so I wanted to keep things simple and readable there.
Set<Task> visited = new HashSet<>(); | ||
|
||
long totalElapsed = 0; | ||
while (!queue.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not often you see graph traversal in a code review 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, right? :)
buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/metrics/MetricsPlugin.java
Outdated
Show resolved
Hide resolved
...Src/src/main/groovy/com/google/firebase/gradle/plugins/ci/metrics/DrainingBuildListener.java
Show resolved
Hide resolved
buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/metrics/StackdriverMetrics.java
Show resolved
Hide resolved
/retest |
2 similar comments
/retest |
/retest |
363dd7d
to
87375a3
Compare
/retest |
Specifically we now report latency and success/failure of each
individual Gradle task.