Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 2963323002: Add analytics to analyzer-cli and analysis server. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 922321474eca22eac1d21a0f19d1fec3c92c6b43..62d222c9c2c2e284ea6c1d179adacdd326517f5f 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -61,6 +61,9 @@ import 'package:front_end/src/base/performace_logger.dart';
import 'package:front_end/src/incremental/byte_store.dart';
import 'package:front_end/src/incremental/file_byte_store.dart';
import 'package:plugin/plugin.dart';
+import 'package:telemetry/crash_reporting.dart';
+import 'package:telemetry/telemetry.dart' as telemetry;
+import 'package:usage/usage.dart';
import 'package:watcher/watcher.dart';
typedef void OptionUpdater(AnalysisOptionsImpl options);
@@ -778,6 +781,9 @@ class AnalysisServer {
new ServerErrorParams(fatal, message, buffer.toString())
.toNotification());
+ // send to crash reporting
+ options.crashReportSender.sendReport(exception, stackTrace: stackTrace);
+
// remember the last few exceptions
if (exception is CaughtException) {
stackTrace ??= exception.stackTrace;
@@ -1051,8 +1057,16 @@ class AnalysisServerOptions {
String clientId;
String clientVersion;
+ telemetry.Analytics analytics;
+ CrashReportSender crashReportSender;
+
// IDE options
bool enableVerboseFlutterCompletions = false;
+
+ void addMocks() {
+ analytics = new AnalyticsMock()..enabled = false;
+ crashReportSender = new CrashReportSender('mock-crash-id', analytics);
+ }
}
/**
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/domain_analysis.dart » ('j') | pkg/analysis_server/lib/src/domain_analysis.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698