dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.06k stars 1.56k forks source link

Improve `dart:developer` Timeline API #56274

Open kenzieschmoll opened 1 month ago

kenzieschmoll commented 1 month ago

Copying feedback for the timeline api from dart:developer over to its own issue in the Dart SDK (original issue: https://github.com/flutter/devtools/issues/8045). CC @bkonyi

Timeline API:

  1. it is very hard to predict on which perfetto "track" my traces will end up on. for instance: calling Timeline.startSync / Timeline.finishSync will (maybe) end up on the flutter ui track, whereas Timeline.instantSync will end up on a different Track.
  2. TimelineTask creates a Track for each layer. this is undesired.
  3. the documentation is very lacking. what does the Map argument in startSync is meant for? what can we do with it?

The most fundamental thing to add to the API is the the ability to have my traces on a separate track. perfetto::Track(_trackId). This way I can view all of them on a single track in the perfetto trace. and not in between all the flutter traces I am not interested in.

dart-github-bot commented 1 month ago

Summary: The dart:developer Timeline API lacks clarity and control over trace placement. Users struggle to predict track assignment and desire a way to group their traces on a dedicated track for easier analysis in Perfetto.