Skip to content

Commit ecd7518

Browse files
authored
Reland "Remove references to Observatory (#118577)" (#121606)
This reverts commit 275ab9c.
1 parent 8fc499a commit ecd7518

File tree

90 files changed

+518
-490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+518
-490
lines changed

.github/ISSUE_TEMPLATE/5_performance_speed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ assignees: ''
4141
can have an intuitive understanding of what happened. Don’t use
4242
"adb screenrecord", as that affects the performance of the profile run.
4343
44-
5. Open Observatory and save a timeline trace of the performance issue
44+
5. Open Flutter DevTools and save a timeline trace of the performance issue
4545
so we know which functions might be causing it. See "How to Collect
4646
and Read Timeline Traces" on this blog post:
4747
https://medium.com/flutter/profiling-flutter-applications-using-the-timeline-a1a434964af3#a499

dev/devicelab/lib/framework/runner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Future<TaskResult> runTask(
202202
.transform<String>(const LineSplitter())
203203
.listen((String line) {
204204
if (!uri.isCompleted) {
205-
final Uri? serviceUri = parseServiceUri(line, prefix: RegExp('(Observatory|The Dart VM service is) listening on '));
205+
final Uri? serviceUri = parseServiceUri(line, prefix: RegExp('The Dart VM service is listening on '));
206206
if (serviceUri != null) {
207207
uri.complete(serviceUri);
208208
}

dev/devicelab/lib/framework/utils.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,14 +664,14 @@ Future<void> runAndCaptureAsyncStacks(Future<void> Function() callback) {
664664
bool canRun(String path) => _processManager.canRun(path);
665665

666666
final RegExp _obsRegExp =
667-
RegExp('An Observatory debugger .* is available at: ');
667+
RegExp('A Dart VM Service .* is available at: ');
668668
final RegExp _obsPortRegExp = RegExp(r'(\S+:(\d+)/\S*)$');
669669
final RegExp _obsUriRegExp = RegExp(r'((http|//)[a-zA-Z0-9:/=_\-\.\[\]]+)');
670670

671671
/// Tries to extract a port from the string.
672672
///
673673
/// The `prefix`, if specified, is a regular expression pattern and must not contain groups.
674-
/// `prefix` defaults to the RegExp: `An Observatory debugger .* is available at: `.
674+
/// `prefix` defaults to the RegExp: `A Dart VM Service .* is available at: `.
675675
int? parseServicePort(String line, {
676676
Pattern? prefix,
677677
}) {
@@ -689,7 +689,7 @@ int? parseServicePort(String line, {
689689
/// Tries to extract a URL from the string.
690690
///
691691
/// The `prefix`, if specified, is a regular expression pattern and must not contain groups.
692-
/// `prefix` defaults to the RegExp: `An Observatory debugger .* is available at: `.
692+
/// `prefix` defaults to the RegExp: `A Dart VM Service .* is available at: `.
693693
Uri? parseServiceUri(String line, {
694694
Pattern? prefix,
695695
}) {

dev/devicelab/lib/tasks/perf_tests.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,11 +1184,11 @@ class PerfTestWithSkSL extends PerfTest {
11841184
await _generateSkSL();
11851185

11861186
// Build the app with SkSL artifacts and run that app
1187-
final String observatoryUri = await _runApp(skslPath: _skslJsonFileName);
1187+
final String vmServiceUri = await _runApp(skslPath: _skslJsonFileName);
11881188

11891189
// Attach to the running app and run the final driver test to get metrics.
11901190
final TaskResult result = await internalRun(
1191-
existingApp: observatoryUri,
1191+
existingApp: vmServiceUri,
11921192
);
11931193

11941194
_runProcess.kill();
@@ -1207,8 +1207,8 @@ class PerfTestWithSkSL extends PerfTest {
12071207
// `--write-sksl-on-exit` option doesn't seem to be compatible with
12081208
// `flutter drive --existing-app` as it will complain web socket connection
12091209
// issues.
1210-
final String observatoryUri = await _runApp(cacheSkSL: true);
1211-
await super.internalRun(cacheSkSL: true, existingApp: observatoryUri);
1210+
final String vmServiceUri = await _runApp(cacheSkSL: true);
1211+
await super.internalRun(cacheSkSL: true, existingApp: vmServiceUri);
12121212
_runProcess.kill();
12131213
await _runProcess.exitCode;
12141214

dev/devicelab/test/utils_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void main() {
1919

2020
group('parse service', () {
2121
const String badOutput = 'No uri here';
22-
const String sampleOutput = 'An Observatory debugger and profiler on '
22+
const String sampleOutput = 'A Dart VM Service on '
2323
'Pixel 3 XL is available at: http://127.0.0.1:9090/LpjUpsdEjqI=/';
2424

2525
test('uri', () {

packages/flutter/lib/src/foundation/binding.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ abstract class BindingBase {
138138
/// First calls [initInstances] to have bindings initialize their
139139
/// instance pointers and other state, then calls
140140
/// [initServiceExtensions] to have bindings initialize their
141-
/// observatory service extensions, if any.
141+
/// VM service extensions, if any.
142142
BindingBase() {
143143
developer.Timeline.startSync('Framework initialization');
144144
assert(() {

packages/flutter/lib/src/painting/shader_warm_up.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ abstract class ShaderWarmUp {
6969
///
7070
/// To decide which draw operations to be added to your custom warm up
7171
/// process, consider capturing an skp using `flutter screenshot
72-
/// --observatory-uri=<uri> --type=skia` and analyzing it with
72+
/// --vm-service-uri=<uri> --type=skia` and analyzing it with
7373
/// <https://debugger.skia.org/>. Alternatively, one may run the app with
7474
/// `flutter run --trace-skia` and then examine the raster thread in the
75-
/// observatory timeline to see which Skia draw operations are commonly used,
75+
/// Flutter DevTools timeline to see which Skia draw operations are commonly used,
7676
/// and which shader compilations are causing jank.
7777
@protected
7878
Future<void> warmUpOnCanvas(ui.Canvas canvas);

packages/flutter/lib/src/widgets/app.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ class WidgetsApp extends StatefulWidget {
11721172

11731173
/// If true, forces the performance overlay to be visible in all instances.
11741174
///
1175-
/// Used by the `showPerformanceOverlay` observatory extension.
1175+
/// Used by the `showPerformanceOverlay` VM service extension.
11761176
static bool showPerformanceOverlayOverride = false;
11771177

11781178
/// If true, forces the widget inspector to be visible.
@@ -1182,12 +1182,12 @@ class WidgetsApp extends StatefulWidget {
11821182
/// The inspector allows you to select a location on your device or emulator
11831183
/// and view what widgets and render objects associated with it. An outline of
11841184
/// the selected widget and some summary information is shown on device and
1185-
/// more detailed information is shown in the IDE or Observatory.
1185+
/// more detailed information is shown in the IDE or DevTools.
11861186
static bool debugShowWidgetInspectorOverride = false;
11871187

11881188
/// If false, prevents the debug banner from being visible.
11891189
///
1190-
/// Used by the `debugAllowBanner` observatory extension.
1190+
/// Used by the `debugAllowBanner` VM service extension.
11911191
///
11921192
/// This is how `flutter run` turns off the banner when you take a screen shot
11931193
/// with "s".

packages/flutter/lib/src/widgets/debug.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ import 'table.dart';
3333
/// Combined with [debugPrintScheduleBuildForStacks], this lets you watch a
3434
/// widget's dirty/clean lifecycle.
3535
///
36-
/// To get similar information but showing it on the timeline available from the
37-
/// Observatory rather than getting it in the console (where it can be
36+
/// To get similar information but showing it on the timeline available from
37+
/// Flutter DevTools rather than getting it in the console (where it can be
3838
/// overwhelming), consider [debugProfileBuildsEnabled].
3939
///
4040
/// See also:

packages/flutter/lib/src/widgets/widget_inspector.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ class _WidgetInspectorService = Object with WidgetInspectorService;
703703
/// operation making it easier to avoid memory leaks.
704704
///
705705
/// All methods in this class are appropriate to invoke from debugging tools
706-
/// using the Observatory service protocol to evaluate Dart expressions of the
706+
/// using the VM service protocol to evaluate Dart expressions of the
707707
/// form `WidgetInspectorService.instance.methodName(arg1, arg2, ...)`. If you
708708
/// make changes to any instance method of this class you need to verify that
709709
/// the [Flutter IntelliJ Plugin](https://github.com/flutter/flutter-intellij/blob/master/README.md)
@@ -712,7 +712,7 @@ class _WidgetInspectorService = Object with WidgetInspectorService;
712712
/// All methods returning String values return JSON.
713713
mixin WidgetInspectorService {
714714
/// Ring of cached JSON values to prevent JSON from being garbage
715-
/// collected before it can be requested over the Observatory protocol.
715+
/// collected before it can be requested over the VM service protocol.
716716
final List<String?> _serializeRing = List<String?>.filled(20, null);
717717
int _serializeRingIndex = 0;
718718

@@ -739,7 +739,7 @@ mixin WidgetInspectorService {
739739
/// when the inspection target changes on device.
740740
InspectorSelectionChangedCallback? selectionChangedCallback;
741741

742-
/// The Observatory protocol does not keep alive object references so this
742+
/// The VM service protocol does not keep alive object references so this
743743
/// class needs to manually manage groups of objects that should be kept
744744
/// alive.
745745
final Map<String, Set<_InspectorReferenceData>> _groups = <String, Set<_InspectorReferenceData>>{};
@@ -1690,7 +1690,7 @@ mixin WidgetInspectorService {
16901690

16911691
/// Wrapper around `json.encode` that uses a ring of cached values to prevent
16921692
/// the Dart garbage collector from collecting objects between when
1693-
/// the value is returned over the Observatory protocol and when the
1693+
/// the value is returned over the VM service protocol and when the
16941694
/// separate observatory protocol command has to be used to retrieve its full
16951695
/// contents.
16961696
//

packages/flutter_tools/bin/fuchsia_tester.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Future<void> run(List<String> args) async {
148148
),
149149
),
150150
watcher: collector,
151-
enableObservatory: collector != null,
151+
enableVmService: collector != null,
152152
precompiledDillFiles: tests,
153153
concurrency: math.max(1, globals.platform.numberOfProcessors - 2),
154154
icudtlPath: globals.fs.path.absolute(argResults[_kOptionIcudtl] as String),

packages/flutter_tools/bin/xcode_backend.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class Context {
6060
// Thinning is handled during the bundle asset assemble build target, so just embed.
6161
embedFlutterFrameworks();
6262
break;
63-
case 'test_observatory_bonjour_service':
63+
case 'test_vm_service_bonjour_service':
6464
// Exposed for integration testing only.
65-
addObservatoryBonjourService();
65+
addVmServiceBonjourService();
6666
}
6767
}
6868

@@ -220,11 +220,11 @@ class Context {
220220
],
221221
);
222222

223-
addObservatoryBonjourService();
223+
addVmServiceBonjourService();
224224
}
225225

226-
// Add the observatory publisher Bonjour service to the produced app bundle Info.plist.
227-
void addObservatoryBonjourService() {
226+
// Add the vmService publisher Bonjour service to the produced app bundle Info.plist.
227+
void addVmServiceBonjourService() {
228228
final String buildMode = parseFlutterBuildMode();
229229

230230
// Debug and profile only.
@@ -239,13 +239,13 @@ class Context {
239239
// The file will be present on re-run.
240240
echo(
241241
'${environment['INFOPLIST_PATH'] ?? ''} does not exist. Skipping '
242-
'_dartobservatory._tcp NSBonjourServices insertion. Try re-building to '
242+
'_dartVmService._tcp NSBonjourServices insertion. Try re-building to '
243243
'enable "flutter attach".');
244244
return;
245245
}
246246

247247
// If there are already NSBonjourServices specified by the app (uncommon),
248-
// insert the observatory service name to the existing list.
248+
// insert the vmService service name to the existing list.
249249
ProcessResult result = runSync(
250250
'plutil',
251251
<String>[
@@ -265,19 +265,19 @@ class Context {
265265
'-insert',
266266
'NSBonjourServices.0',
267267
'-string',
268-
'_dartobservatory._tcp',
268+
'_dartVmService._tcp',
269269
builtProductsPlist,
270270
],
271271
);
272272
} else {
273-
// Otherwise, add the NSBonjourServices key and observatory service name.
273+
// Otherwise, add the NSBonjourServices key and vmService service name.
274274
runSync(
275275
'plutil',
276276
<String>[
277277
'-insert',
278278
'NSBonjourServices',
279279
'-json',
280-
'["_dartobservatory._tcp"]',
280+
'["_dartVmService._tcp"]',
281281
builtProductsPlist,
282282
],
283283
);

packages/flutter_tools/doc/attach.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ immediately discover the port
1717
will search for an already running Flutter app or module if available.
1818
Otherwise, the tool will wait for the next Flutter app or module to launch
1919
before attaching.
20-
1. If the app or module is already running and the specific observatory port is
20+
1. If the app or module is already running and the specific VM Service port is
2121
known, it can be explicitly provided to attach via the command-line, e.g.
2222
`$ flutter attach --debug-port 12345`
2323

packages/flutter_tools/doc/daemon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ This is sent when an app is starting. The `params` field will be a map with the
140140

141141
#### app.debugPort
142142

143-
This is sent when an observatory port is available for a started app. The `params` field will be a map with the fields `appId`, `port`, and `wsUri`. Clients should prefer using the `wsUri` field in preference to synthesizing a URI using the `port` field. An optional field, `baseUri`, is populated if a path prefix is required for setting breakpoints on the target device.
143+
This is sent when a VM service port is available for a started app. The `params` field will be a map with the fields `appId`, `port`, and `wsUri`. Clients should prefer using the `wsUri` field in preference to synthesizing a URI using the `port` field. An optional field, `baseUri`, is populated if a path prefix is required for setting breakpoints on the target device.
144144

145145
#### app.started
146146

packages/flutter_tools/lib/src/android/android_device.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,12 @@ class AndroidDevice extends Device {
599599
}
600600

601601
final bool traceStartup = platformArgs['trace-startup'] as bool? ?? false;
602-
ProtocolDiscovery? observatoryDiscovery;
602+
ProtocolDiscovery? vmServiceDiscovery;
603603

604604
if (debuggingOptions.debuggingEnabled) {
605-
observatoryDiscovery = ProtocolDiscovery.observatory(
605+
vmServiceDiscovery = ProtocolDiscovery.vmService(
606606
// Avoid using getLogReader, which returns a singleton instance, because the
607-
// observatory discovery will dispose at the end. creating a new logger here allows
607+
// VM Service discovery will dipose at the end. creating a new logger here allows
608608
// logs to be surfaced normally during `flutter drive`.
609609
await AdbLogReader.createLogReader(
610610
this,
@@ -687,26 +687,26 @@ class AndroidDevice extends Device {
687687
}
688688

689689
// Wait for the service protocol port here. This will complete once the
690-
// device has printed "Observatory is listening on...".
691-
_logger.printTrace('Waiting for observatory port to be available...');
690+
// device has printed "VM Service is listening on...".
691+
_logger.printTrace('Waiting for VM Service port to be available...');
692692
try {
693-
Uri? observatoryUri;
693+
Uri? vmServiceUri;
694694
if (debuggingOptions.buildInfo.isDebug || debuggingOptions.buildInfo.isProfile) {
695-
observatoryUri = await observatoryDiscovery?.uri;
696-
if (observatoryUri == null) {
695+
vmServiceUri = await vmServiceDiscovery?.uri;
696+
if (vmServiceUri == null) {
697697
_logger.printError(
698698
'Error waiting for a debug connection: '
699699
'The log reader stopped unexpectedly',
700700
);
701701
return LaunchResult.failed();
702702
}
703703
}
704-
return LaunchResult.succeeded(observatoryUri: observatoryUri);
704+
return LaunchResult.succeeded(vmServiceUri: vmServiceUri);
705705
} on Exception catch (error) {
706706
_logger.printError('Error waiting for a debug connection: $error');
707707
return LaunchResult.failed();
708708
} finally {
709-
await observatoryDiscovery?.cancel();
709+
await vmServiceDiscovery?.cancel();
710710
}
711711
}
712712

packages/flutter_tools/lib/src/base/dds.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class DartDevelopmentService {
3535
final Completer<void> _completer = Completer<void>();
3636

3737
Future<void> startDartDevelopmentService(
38-
Uri observatoryUri, {
38+
Uri vmServiceUri, {
3939
required Logger logger,
4040
int? hostPort,
4141
bool? ipv6,
@@ -49,11 +49,11 @@ class DartDevelopmentService {
4949
);
5050
logger.printTrace(
5151
'Launching a Dart Developer Service (DDS) instance at $ddsUri, '
52-
'connecting to VM service at $observatoryUri.',
52+
'connecting to VM service at $vmServiceUri.',
5353
);
5454
try {
5555
_ddsInstance = await ddsLauncherCallback(
56-
observatoryUri,
56+
vmServiceUri,
5757
serviceUri: ddsUri,
5858
enableAuthCodes: disableServiceAuthCodes != true,
5959
ipv6: ipv6 ?? false,

packages/flutter_tools/lib/src/build_info.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,16 +394,16 @@ class BuildMode {
394394
throw ArgumentError('$value is not a supported build mode');
395395
}
396396

397-
/// Built in JIT mode with no optimizations, enabled asserts, and an observatory.
397+
/// Built in JIT mode with no optimizations, enabled asserts, and a VM service.
398398
static const BuildMode debug = BuildMode._('debug');
399399

400-
/// Built in AOT mode with some optimizations and an observatory.
400+
/// Built in AOT mode with some optimizations and a VM service.
401401
static const BuildMode profile = BuildMode._('profile');
402402

403-
/// Built in AOT mode with all optimizations and no observatory.
403+
/// Built in AOT mode with all optimizations and no VM service.
404404
static const BuildMode release = BuildMode._('release');
405405

406-
/// Built in JIT mode with all optimizations and no observatory.
406+
/// Built in JIT mode with all optimizations and no VM service.
407407
static const BuildMode jitRelease = BuildMode._('jit_release');
408408

409409
static const List<BuildMode> values = <BuildMode>[

0 commit comments

Comments
 (0)