Skip to content

Commit 30c418b

Browse files
authored
Analytics. Add libraryDiagnosticsBundleFailures to Event.analysisStatistics (#2250)
1 parent 122d9ac commit 30c418b

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

pkgs/unified_analytics/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 8.0.9
2+
- Added `libraryDiagnosticsBundleFailures` to `Event.analysisStatistics`.
3+
14
## 8.0.8
25
- More data for `Event.analysisStatistics` for events from Dart Analysis Server.
36

pkgs/unified_analytics/lib/src/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const int kMaxLogFileSize = 25 * (1 << 20);
8787
const String kLogFileName = 'dart-flutter-telemetry.log';
8888

8989
/// The current version of the package, should be in line with pubspec version.
90-
const String kPackageVersion = '8.0.8';
90+
const String kPackageVersion = '8.0.9';
9191

9292
/// The minimum length for a session.
9393
const int kSessionDurationMinutes = 30;

pkgs/unified_analytics/lib/src/event.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ final class Event {
147147
/// producing diagnostics.
148148
/// * [produceErrorsElementsDurationMs] - the total duration in milliseconds
149149
/// for preparing elements before analysis.
150+
/// * [libraryDiagnosticsBundleFailures] - the counts of requirement failures
151+
/// for library diagnostics bundles. The key is the `kindId` of the
152+
/// `RequirementFailure`.
150153
///
151154
/// This allows us to understand how many files were scheduled for analysis,
152155
/// and how many of these files are served from the cache, because we
@@ -171,6 +174,7 @@ final class Event {
171174
required int produceErrorsActualFileLineCount,
172175
required int produceErrorsDurationMs,
173176
required int produceErrorsElementsDurationMs,
177+
required String libraryDiagnosticsBundleFailures,
174178
}) : this._(
175179
eventName: DashEvent.analysisStatistics,
176180
eventData: {
@@ -194,6 +198,8 @@ final class Event {
194198
produceErrorsActualFileLineCount,
195199
'produceErrorsDurationMs': produceErrorsDurationMs,
196200
'produceErrorsElementsDurationMs': produceErrorsElementsDurationMs,
201+
'libraryDiagnosticsBundleFailures':
202+
libraryDiagnosticsBundleFailures,
197203
},
198204
);
199205

pkgs/unified_analytics/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >-
55
# LINT.IfChange
66
# When updating this, keep the version consistent with the changelog and the
77
# value in lib/src/constants.dart.
8-
version: 8.0.8
8+
version: 8.0.9
99
# LINT.ThenChange(lib/src/constants.dart)
1010
repository: https://github.com/dart-lang/tools/tree/main/pkgs/unified_analytics
1111
issue_tracker: https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics

pkgs/unified_analytics/test/event_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void main() {
3030
produceErrorsActualFileLineCount: 13,
3131
produceErrorsDurationMs: 14,
3232
produceErrorsElementsDurationMs: 15,
33+
libraryDiagnosticsBundleFailures: 'id1:1,id2:2',
3334
);
3435

3536
final constructedEvent = generateEvent();
@@ -57,7 +58,11 @@ void main() {
5758
expect(constructedEvent.eventData['produceErrorsActualFileLineCount'], 13);
5859
expect(constructedEvent.eventData['produceErrorsDurationMs'], 14);
5960
expect(constructedEvent.eventData['produceErrorsElementsDurationMs'], 15);
60-
expect(constructedEvent.eventData.length, 16);
61+
expect(
62+
constructedEvent.eventData['libraryDiagnosticsBundleFailures'],
63+
'id1:1,id2:2',
64+
);
65+
expect(constructedEvent.eventData.length, 17);
6166
});
6267

6368
test('Event.analyticsCollectionEnabled constructed', () {

0 commit comments

Comments
 (0)