This message was deleted.
# develocity
s
This message was deleted.
n
There are two indications that the configuration cache was reused on a build scan: In the Performance -> Configuration tab you will see the time it took to reload the configuration cache. In the Console Log you will see
Reusing configuration cache.
i
Hey @Gabriel Feo! As Nelson mentioned, this is not something which you can get via GE API for now. We will take this into consideration as a possible improvement though.
m
You can instrument this yourself though. I've done the following in my project: • Create a build service that implements
OperationCompletionListener
• Have the build service manage an
AtomicBoolean
to indicate whether or not the service was "explicitly started". Expose an
explicitStart()
method to compareAndSet this from false to true. • In a plugin, register the above service and call
.get().explicitStart()
. This will only happen in the configuration phase. • Thus, due to the above, your service can override
onFinish
and compareAndSet the explicit start AtomicBooelan from false to true. If this succeeds then you know the configuration phase was skipped, indicating that the configuration was pulled from the config cache.
g
Thank you for the replies. Since I needed to distinguish this on past builds, logging it now wouldn't work for me, but I found a way to read it from the API. Basically, for each build from the REST API, I query the Build Export API
/build-export/v2/build/{id}/events?eventTypes=ConfigurationCacheLoadStarted
. If response contains a BuildEvent, then cache was reused, else it wasn't.