Skip to content

Conversation

@pq
Copy link
Collaborator

@pq pq commented Dec 3, 2025

Adds a new Analytics service built on a DTDProcess that checks analytics status and can be run before DAS startup.

For example,

...

UnifiedAnalyticsData analyticsData = Analytics.initialize(sdk);

// Pass in data or a flag to indicate if analytics should be enabled for this run.
startServer(sdk);
...

There are a few TODOs and a concurrency issue to address but this seems to be holding up under a bunch of local testing and is big enough to merit a look before I do more wiring up.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

@pq pq requested review from helin24 and jwren December 3, 2025 18:51
Copy link
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks reasonable! Do we have a sense of how long this checking takes? I'm assuming it wouldn't make sense to start analysis server without analytics and then restart it when DTD is up?

params.addProperty("tool", getToolName())

try {
data!!.shouldShowMessage =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is !! necessary in all of these instances? Can we instead lateinit or something like that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little leery of lateinit since it's so global but I'm with you that this looks gross. I'll investigate on the next pass.

Thanks for the nudge!

@pq
Copy link
Collaborator Author

pq commented Dec 5, 2025

Getting timing analytics would be a great idea. I think in the common case it will be VERY fast but at the corners, dunno.

Will add a TODO.

Thanks!

@pq pq merged commit 5ca36bf into flutter:main Dec 5, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants