Skip to content

Commit

Permalink
Added commandHasTerminal to event
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasyishak committed Nov 14, 2023
1 parent 4e75286 commit 731561b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 5.5.0

- Edit to the `Event.flutterCommandResult` constructor to add `commandHasTerminal`

## 5.4.0

- Added the `Event.codeSizeAnalysis` 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 @@ -82,7 +82,7 @@ const int kLogFileLength = 2500;
const String kLogFileName = 'dart-flutter-telemetry.log';

/// The current version of the package, should be in line with pubspec version.
const String kPackageVersion = '5.4.0';
const String kPackageVersion = '5.5.0';

/// The minimum length for a session.
const int kSessionDurationMinutes = 30;
Expand Down
7 changes: 7 additions & 0 deletions pkgs/unified_analytics/lib/src/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,21 @@ final class Event {
/// [commandPath] - information about the flutter command, such as "build/apk".
///
/// [result] - if the command failed or succeeded.
///
/// [commandHasTerminal] - boolean indicating if the flutter command ran with
/// a terminal.
///
/// [maxRss] - maximum resident size for a given flutter command.
Event.flutterCommandResult({
required String commandPath,
required String result,
required bool commandHasTerminal,
int? maxRss,
}) : eventName = DashEvent.flutterCommandResult,
eventData = {
'commandPath': commandPath,
'result': result,
'commandHasTerminal': commandHasTerminal,
if (maxRss != null) 'maxRss': maxRss,
};

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 @@ -4,7 +4,7 @@ description: >-
to Google Analytics.
# When updating this, keep the version consistent with the changelog and the
# value in lib/src/constants.dart.
version: 5.4.0
version: 5.5.0
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics

environment:
Expand Down
4 changes: 3 additions & 1 deletion pkgs/unified_analytics/test/event_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ void main() {
Event generateEvent() => Event.flutterCommandResult(
commandPath: 'commandPath',
result: 'result',
commandHasTerminal: true,
maxRss: 123,
);

Expand All @@ -394,8 +395,9 @@ void main() {
expect(constructedEvent.eventName, DashEvent.flutterCommandResult);
expect(constructedEvent.eventData['commandPath'], 'commandPath');
expect(constructedEvent.eventData['result'], 'result');
expect(constructedEvent.eventData['commandHasTerminal'], true);
expect(constructedEvent.eventData['maxRss'], 123);
expect(constructedEvent.eventData.length, 3);
expect(constructedEvent.eventData.length, 4);
});

test('Event.codeSizeAnalysis constructed', () {
Expand Down

0 comments on commit 731561b

Please sign in to comment.