This message was deleted.
# community-support
s
This message was deleted.
v
Are you aware that
BuildOperationListener
is an internal class? You probably wanted an
OperationCompletionListener
instead.
There you can get from the first
TaskFinishEvent
the
TaskOperationResult
which contains the task start time. That at least gives you the start time of the first started task. Whether that is "the start of the execution phase"? I guess so. 😄
r
Yep, I’m already using the
OperationCompletionListener
to obtain task information. I personally wasn’t aware that
BuildOperationListener
. Here it says it’s public
public interface BuildOperationListener
but I see it’s inside internal package… So I assume I shouldn’t be using it due to unexpected API changes in the future could happen? And regarding configuration phase: I’m assuming that I can obtain the configuration phase time since the plugin is registered to the first task event start time. Would that be a safe metric?
v
"Since the plugin is registered" sounds pretty unsafe though, unless it is a settings plugin.
âž• 1
And even you miss things that happened before and so on.
Actually the easiest would be to use build scans, as there you have all numbers you might need. 😄
Or maybe
--profile
gives you the information you want. I forgot what its result contains.
r
It’s actually unsafe because I’m missing some stuff that happens before…. The thing is that I want to collect the data and store it in a database and keep track of it. (And learn gradle on the way) Using
gradle-profiler
or
scan
is doing direct work and triggering it on purpose. e.g:
gradle-profiler --profiler
or
gradle-profiler --scan
I want to be able to keep working on X project and after some time go to the database and visualize the data I’ve been tracking for all this time. Not sure if it makes sense, I know I have gradle scan but I rather keep my info for myself by obtaining the raw data I want.
I wonder if there’s a way to obtain the time it took for whole project to be configured from gradle api 🤔
v
Sounds like you need to buy Develocity, then you have the data you want also in a historicaly view 😄
> I wonder if there’s a way to obtain the time it took for whole project to be configured from gradle api I have no idea.
Try to reverse engineer the build scan logic, but I bet it uses internal stuff. And it is obfuscated.
I guess one of the earliest things where you could record a start time is an init script if you can use one.
Next best thing, probably the
pluginManagement
block in the settings script