Skip to content
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

AddisV2Inspector to the Event.devtoolsEvent constructor. #1192

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 6.1.6-wip
- Added `isV2Inspector` to the `Event.devtoolsEvent` constructor.

## 6.1.5
- Remove any `data` entries with a null value in the `Event.exception` constructor.

Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20);
const String kLogFileName = 'dart-flutter-telemetry.log';

/// The current version of the package, should be in line with pubspec version.
const String kPackageVersion = '6.1.5';
const String kPackageVersion = '6.1.6-wip';

/// The minimum length for a session.
const int kSessionDurationMinutes = 30;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/unified_analytics/lib/src/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ final class Event {
int? rootSetCount,
int? rowCount,
int? inspectorTreeControllerId,
bool? isV2Inspector,
Copy link
Contributor

Choose a reason for hiding this comment

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

after going through the churn of needing to update unified_analytics each time we want to track something new, I propose we add a map to the constructor Map<String, Object?> additionalMetrics = const {} and then add it to the eventData map like:

...additionalMetrics..removeWhere((key, value) => value == null)

and then we can deprecate all of the screen metrics here (from uiDurationMicros down to the bottom). These values are likely to change over time as we iterate on the different DevTools pages, and this would prevent us from having to change the unified_analytics package every time we need to add / remove a param.

WDYT?


// DeepLinkScreenMetrics
String? androidAppId,
Expand Down Expand Up @@ -450,6 +451,7 @@ final class Event {
if (rowCount != null) 'rowCount': rowCount,
if (inspectorTreeControllerId != null)
'inspectorTreeControllerId': inspectorTreeControllerId,
if (isV2Inspector != null) 'isV2Inspector': isV2Inspector,
// DeepLinkScreenMetrics
if (androidAppId != null) 'androidAppId': androidAppId,
if (iosBundleId != null) 'iosBundleId': iosBundleId,
Expand Down
2 changes: 1 addition & 1 deletion pkgs/unified_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
# LINT.IfChange
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
version: 6.1.5
version: 6.1.6-wip
# LINT.ThenChange(lib/src/constants.dart)
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics
Expand Down
2 changes: 2 additions & 0 deletions pkgs/unified_analytics/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ void main() {
rootSetCount: 123,
rowCount: 123,
inspectorTreeControllerId: 123,
isV2Inspector: true,
androidAppId: 'androidAppId',
iosBundleId: 'iosBundleId',
);
Expand Down Expand Up @@ -624,6 +625,7 @@ void main() {
expect(constructedEvent.eventData['rootSetCount'], 123);
expect(constructedEvent.eventData['rowCount'], 123);
expect(constructedEvent.eventData['inspectorTreeControllerId'], 123);
expect(constructedEvent.eventData['isV2Inspector'], true);
expect(constructedEvent.eventData['androidAppId'], 'androidAppId');
expect(constructedEvent.eventData['iosBundleId'], 'iosBundleId');
expect(constructedEvent.eventData.length, 30);
Expand Down
Loading