-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event
Constructor added for devtools event
#258
Conversation
Event
Constructor added for devtools event
/// 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, | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @kenzieschmoll ^
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
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-lang/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 <devoncarew@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Part of tracker issue:
package:unified_analytics
for 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
Event
calledEvent.devtoolsAction
The 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.