Skip to content

Instantly share code, notes, and snippets.

@gabrielfeo
Created October 14, 2024 11:45
Show Gist options
  • Save gabrielfeo/419d6659a1afcb863b598b7f287b6dc1 to your computer and use it in GitHub Desktop.
Save gabrielfeo/419d6659a1afcb863b598b7f287b6dc1 to your computer and use it in GitHub Desktop.
Randomize Gradle remote cache path for benchmarking upload performance
// Randomizes the cache path so that builds always miss and push cache entries
// to the remote cache. Used to benchmark upload performance when making changes
// to a Develocity instance. Configuration cache must be disabled so that
// a random path is never re-used.
settingsEvaluated { settings ->
settings.with {
// This impl will only work with the Develocity build cache type
assert buildCache.remote.class.name.contains('com.gradle.develocity')
buildCache.remote.path = "cache/${UUID.randomUUID()}"
logger.lifecycle("[randomize-remote-cache-url] remote.path=${buildCache.remote.path}")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment