Skip to content

Commit

Permalink
adding conf cache hit Default Build Metric (#379)
Browse files Browse the repository at this point in the history
* affing conf cache hit Default Build Metric

* asserting configurationCacheHit in test
  • Loading branch information
cdsap authored Sep 23, 2023
1 parent 0e07ebf commit 381db27
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class BuildMetrics : Metrics {
SwitchParallel,
SwitchRefreshDependencies,
SwitchRerunTasks,
ConfigurationCacheHit,
Custom {
override val isCustom: Boolean = true
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DefaultBuildMetricsProvider(

map[BuildMetrics.Duration.toKey()] = report.durationMs?.toLong() ?: 0L
map[BuildMetrics.Configuration.toKey()] = report.configurationDurationMs?.toLong() ?: 0L

map[BuildMetrics.ConfigurationCacheHit.toKey()] = report.configurationCacheHit
with(report) {
success.let { map[BuildMetrics.Success.toKey()] = it }
buildId?.let { map[BuildMetrics.BuildId.toKey()] = it }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class DefaultBuildMetricsProviderTest : BehaviorSpec({
"start" to "1.590661991331E12".toDouble(),
"duration" to 10L,
"configuration" to 32L,
"configurationCacheHit" to false,
"success" to true,
"buildId" to "12",
"rootProject" to "app",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ object ExecutionReportProvider {
requestedTasks = "app:assembleDebug",
buildInvocationId = "123",
configurationDurationMs = "32",
configurationCacheHit = false,
environment = Environment(
cpuCount = "4",
osVersion = "Linux 1.4",
Expand Down

0 comments on commit 381db27

Please sign in to comment.