Gradle Plugin for reporting build metrics at the end of the build.
- Add own, custom reporters and send metrics to any system
- Configuration Cache compatibility
- Gradle Enterprise integration - optionally attach Gradle Scan Id to the metrics
// settings.gradle
plugins {
id "com.gradle.enterprise" version "latest_version" // optional
}
// build.gradle
import com.automattic.android.measure.reporters.MetricsReport
import com.automattic.android.measure.reporters.SlowSlowTasksMetricsReporter
plugins {
id "com.automattic.android.measure-builds" version "latest_tag"
}
measureBuilds {
enable = true
attachGradleScanId = true // `false`, if no Enterprise plugin applied OR don't want to attach build scan id
onBuildMetricsReadyListener { MetricsReport metricsReport ->
// Use ready reporters
SlowSlowTasksMetricsReporter.report(metricsReport)
// or add your own reporters here or use
MyCustomReporter.report(metricsReport)
}
}
Property | Default | Description |
---|---|---|
enable | false |
Enable plugin |
onBuildMetricsReadyListener | Callback to be called when build metrics are ready to be reported. Use this to add your own reporters. | |
attachGradleScanId | false |
Upload metrics after build scan is published, with build scan id attached. If false , metrics will be uploaded upon build finish, without build scan id attached |
obfuscateUsername | false |
Obfuscate system username with SHA-1 |
![image](https://private-user-images.githubusercontent.com/5845095/287269863-62525db1-73bf-4fa8-ad67-59ad0e213748.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNjkwMzMsIm5iZiI6MTczOTA2ODczMywicGF0aCI6Ii81ODQ1MDk1LzI4NzI2OTg2My02MjUyNWRiMS03M2JmLTRmYTgtYWQ2Ny01OWFkMGUyMTM3NDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMDIzODUzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjFiMTBkNDc0YjFlNGE5ODliNTk4NDg0OGZhMTY3ZjM2Y2FlZGYzNWNhOTA4ZDEzNDA1Y2JmMzNmZjc3NGViNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.qlnl185NATAqv13EH2P3R-DO9VBR4SmS8KNAD2s54ZI)