Repository navigation
Event Constructor added for devtools event - #258
Merged
Merged
Conversation
eliasyishak
commented
Mar 27, 2024
Event Constructor added for devtools event
10 of 11 tasks
eliasyishak
commented
Apr 18, 2024
Comment on lines
+359
to
+448
| /// Event that is sent from devtools for various different actions as | ||
| /// indicated by the [eventCategory]. | ||
| Event.devtoolsEvent({ | ||
| required String eventCategory, | ||
| required String label, | ||
| required int value, | ||
|
|
||
| // Defaulted values | ||
| bool userInitiatedInteraction = true, | ||
|
|
||
| // Optional parameters | ||
| String? g3Username, | ||
| String? userApp, | ||
| String? userBuild, | ||
| String? userPlatform, | ||
| String? devtoolsPlatform, | ||
| String? devtoolsChrome, | ||
| String? devtoolsVersion, | ||
| String? ideLaunched, | ||
| String? isExternalBuild, | ||
| String? isEmbedded, | ||
| String? ideLaunchedFeature, | ||
|
|
||
| // PerformanceScreenMetrics | ||
| int? uiDurationMicros, | ||
| int? rasterDurationMicros, | ||
| int? shaderCompilationDurationMicros, | ||
| int? traceEventCount, | ||
|
|
||
| // ProfilerScreenMetrics | ||
| int? cpuSampleCount, | ||
| int? cpuStackDepth, | ||
|
|
||
| // MemoryScreenMetrics | ||
| int? heapDiffObjectsBefore, | ||
| int? heapDiffObjectsAfter, | ||
| int? heapObjectsTotal, | ||
|
|
||
| // InspectorScreenMetrics | ||
| int? rootSetCount, | ||
| int? rowCount, | ||
| int? inspectorTreeControllerId, | ||
| }) : eventName = DashEvent.devtoolsEvent, | ||
| eventData = { | ||
| 'eventCategory': eventCategory, | ||
| 'label': label, | ||
| 'value': value, | ||
|
|
||
| 'userInitiatedInteraction': userInitiatedInteraction, | ||
|
|
||
| // Optional parameters | ||
| if (g3Username != null) 'g3Username': g3Username, | ||
| if (userApp != null) 'userApp': userApp, | ||
| if (userBuild != null) 'userBuild': userBuild, | ||
| if (userPlatform != null) 'userPlatform': userPlatform, | ||
| if (devtoolsPlatform != null) 'devtoolsPlatform': devtoolsPlatform, | ||
| if (devtoolsChrome != null) 'devtoolsChrome': devtoolsChrome, | ||
| if (devtoolsVersion != null) 'devtoolsVersion': devtoolsVersion, | ||
| if (ideLaunched != null) 'ideLaunched': ideLaunched, | ||
| if (isExternalBuild != null) 'isExternalBuild': isExternalBuild, | ||
| if (isEmbedded != null) 'isEmbedded': isEmbedded, | ||
| if (ideLaunchedFeature != null) | ||
| 'ideLaunchedFeature': ideLaunchedFeature, | ||
|
|
||
| // PerformanceScreenMetrics | ||
| if (uiDurationMicros != null) 'uiDurationMicros': uiDurationMicros, | ||
| if (rasterDurationMicros != null) | ||
| 'rasterDurationMicros': rasterDurationMicros, | ||
| if (shaderCompilationDurationMicros != null) | ||
| 'shaderCompilationDurationMicros': shaderCompilationDurationMicros, | ||
| if (traceEventCount != null) 'traceEventCount': traceEventCount, | ||
|
|
||
| // ProfilerScreenMetrics | ||
| if (cpuSampleCount != null) 'cpuSampleCount': cpuSampleCount, | ||
| if (cpuStackDepth != null) 'cpuStackDepth': cpuStackDepth, | ||
|
|
||
| // MemoryScreenMetrics | ||
| if (heapDiffObjectsBefore != null) | ||
| 'heapDiffObjectsBefore': heapDiffObjectsBefore, | ||
| if (heapDiffObjectsAfter != null) | ||
| 'heapDiffObjectsAfter': heapDiffObjectsAfter, | ||
| if (heapObjectsTotal != null) 'heapObjectsTotal': heapObjectsTotal, | ||
|
|
||
| // InspectorScreenMetrics | ||
| if (rootSetCount != null) 'rootSetCount': rootSetCount, | ||
| if (rowCount != null) 'rowCount': rowCount, | ||
| if (inspectorTreeControllerId != null) | ||
| 'inspectorTreeControllerId': inspectorTreeControllerId, | ||
| }; | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Does this look like everything is being captured from the _gtagEvent function?
Referenced from here: https://github.com/eliasyishak/devtools/blob/migrate-select-event/packages/devtools_app/lib/src/shared/analytics/_analytics_web.dart#L196-L254
Contributor
Author
There was a problem hiding this comment.
We have included all of the fields from the linked function above, except for sent_to and flutter_client_id and that is because we have the "send to" for GA4 within the package and the client id is managed by the package and added to the payload on send requests
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
kenzieschmoll
approved these changes
Apr 22, 2024
copybara-service Bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Apr 22, 2024
Revisions updated by `dart tools/rev_sdk_deps.dart`. benchmark_harness (https://github.com/dart-lang/benchmark_harness/compare/d23112a..aa139fd): aa139fd 2024-04-18 William Hesse Add support for running perftools to use hardware performance counters when benchmarking. (dart-archive/benchmark_harness#98) dartdoc (https://github.com/dart-lang/dartdoc/compare/592694e..1ae5b4c): 1ae5b4c0 2024-04-22 dependabot[bot] Bump actions/upload-artifact from 4.3.1 to 4.3.3 (dart-lang/dartdoc#3755) 5934d2d6 2024-04-22 dependabot[bot] Bump actions/checkout from 4.1.2 to 4.1.3 (dart-lang/dartdoc#3754) a9500f0d 2024-04-22 Sam Rawlins Replace hasPrivateName/hasPublicName with one extension getter (dart-lang/dartdoc#3752) tools (https://github.com/dart-lang/tools/compare/d86ea23..3e21ae9): 3e21ae9 2024-04-22 Elias Yishak `Event` Constructor added for devtools event (dart-lang/tools#258) webdev (https://github.com/dart-lang/webdev/compare/3a10b76..d4f9f67): d4f9f672 2024-04-22 Devon Carew remove the dep on package:uuid (dart-lang/webdev#2415) 78555cdd 2024-04-18 Kevin Moore FE server common: move from pkg:usage to pkg:uuid (dart-lang/webdev#2412) 16dce1f2 2024-04-18 Elliott Brooks Pin DCM to latest version (dart-lang/webdev#2410) b0494fb5 2024-04-18 Elliott Brooks Catch errors when calculating frames in the stack trace (dart-lang/webdev#2408) Change-Id: I1d206665e33e5936f4a5bf93e029a7290803895d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364021 Commit-Queue: Devon Carew <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of tracker issue:
package:unified_analyticsfor analytics collection flutter/devtools#7083Devtools uses one large data class for all of their events. This PR is adding that data class as a named constructor under
EventcalledEvent.devtoolsActionThe singular data class can be found here in devtools source code.
Contribution guidelines:
dart format.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.