Skip to content

Commit 60b217f

Browse files
bkonyiCommit Queue
authored andcommitted
[ Observatory ] Remove Observatory from the Dart VM
Also cleans up some references to Observatory in various places. Work towards #50233 TEST=N/A CoreLibraryReviewExempt: Not modifying public core libraries. Change-Id: I1f36b4e6f1fd9a59a579d719aafa599906eedb3f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429141 Reviewed-by: Siva Annamalai <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent d9c681e commit 60b217f

34 files changed

+29
-1209
lines changed

BUILD.gn

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,6 @@ group("dart2js_bot") {
218218
]
219219
}
220220

221-
# This rule and the compressed_observatory_archive rule are for the Fuchsia
222-
# bots that pre-build the Observatory. They copy the observatory tar files to
223-
# the root build output directory for convenient access by the Fuchsia buildbot
224-
# scripts.
225-
group("observatory_archive") {
226-
deps = [ "runtime/observatory:copy_observatory_archive" ]
227-
}
228-
229-
group("compressed_observatory_archive") {
230-
deps = [ "runtime/observatory:copy_compressed_observatory_archive" ]
231-
}
232-
233221
if (is_fuchsia) {
234222
import("third_party/fuchsia/gn-sdk/src/component.gni")
235223
import("third_party/fuchsia/gn-sdk/src/package.gni")

pkg/analysis_server/benchmark/perf/memory_tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class LspAnalysisServerMemoryUsageTest
225225
_vmServicePort = await ServiceProtocol._findAvailableSocketPort();
226226
vmArgs.addAll([
227227
'--enable-vm-service=$_vmServicePort',
228-
'-DSILENT_OBSERVATORY=true',
228+
'-DSILENT_VM_SERVICE=true',
229229
'--disable-service-auth-codes',
230230
'--disable-dart-dev',
231231
'--no-dds',

pkg/analysis_server/test/integration/support/integration_tests.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ class Server {
716716
}
717717

718718
/// Start the server. If [profileServer] is `true`, the server will be started
719-
/// with "--observe" and "--pause-isolates-on-exit", allowing the observatory
719+
/// with "--observe" and "--pause-isolates-on-exit", allowing Dart DevTools
720720
/// to be used.
721721
Future<void> start({
722722
required String dartSdkPath,

pkg/analysis_server/test/stress/utilities/server.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ class Server {
601601
/// the specified port.
602602
///
603603
/// If [profileServer] is `true`, the server will be started with "--observe"
604-
/// and "--pause-isolates-on-exit", allowing the observatory to be used.
604+
/// and "--pause-isolates-on-exit", allowing Dart DevTools to be used.
605605
///
606606
/// If [useAnalysisHighlight2] is `true`, the server will use the new
607607
/// highlight APIs.

pkg/analyzer_plugin/doc/tutorial/debugging.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,12 @@ that will be written to the instrumentation log file. Currently, the best choice
4949
for this is the `plugin.error` notification. Just be sure that `isFatal` has a
5050
value of `false`.
5151

52-
## Using Observatory
52+
## Using Dart DevTools
5353

5454
If the client you're using allows you to pass command-line flags to the VM, then
55-
you can also run the analysis server under the Observatory. Pass in both
55+
you can also run the analysis server under Dart DevTools. Pass in both
5656
`--observe` and `--pause-isolates-on-start`, then point your browser to
57-
`http://localhost:8181`. To learn more, see the
58-
[observatory][observatory] documentation.
57+
`http://localhost:8181`.
5958

6059
If you're using IntelliJ as your client, open the "Registry..." dialog and edit
6160
the entry named "dart.server.vm.options".
62-
63-
[observatory]: https://dart-lang.github.io/observatory/

pkg/compiler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ functionality is publicly exposed.
367367
when run on very large apps.
368368

369369
* `tool/dart2js_stress.dart` and `tool/dart2js_profile_many.dart`: other
370-
helper wrappers to make it easier to profile dart2js with Observatory.
370+
helper wrappers to make it easier to profile dart2js with Dart DevTools.
371371

372372
* Source map tracking (`lib/src/io`): helpers used to track source information
373373
and to build source map files. _TODO: add details_.

pkg/compiler/tool/track_memory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import 'dart:async';
1818

1919
import 'dart:convert';
2020

21-
/// Socket to connect to the vm observatory service.
21+
/// Socket to connect to the VM service.
2222
late WebSocket socket;
2323

2424
Future<void> main(List<String> args) async {

pkg/dartdev/test/commands/run_test.dart

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -885,107 +885,6 @@ main() => print('b:b');
885885
);
886886
});
887887
});
888-
889-
group('Observatory', () {
890-
void generateServedTest({
891-
required bool serve,
892-
required bool enableAuthCodes,
893-
required bool explicitRun,
894-
required bool withDds,
895-
}) {
896-
test(
897-
'${serve ? 'served by default' : 'not served'} ${enableAuthCodes ? "with" : "without"} '
898-
'auth codes, ${explicitRun ? 'explicit' : 'implicit'} run,${withDds ? ' ' : 'no'} DDS',
899-
() async {
900-
p = project(
901-
mainSrc:
902-
'void main() { print("ready"); int i = 0; while(true) { i++; } }',
903-
);
904-
Process process = await p.start([
905-
if (explicitRun) 'run',
906-
'--enable-vm-service=0',
907-
if (!withDds) '--no-dds',
908-
if (!enableAuthCodes) '--disable-service-auth-codes',
909-
if (serve) '--serve-observatory',
910-
p.relativeFilePath,
911-
]);
912-
913-
final completer = Completer<void>();
914-
915-
late final StreamSubscription<String> sub;
916-
late final String uri;
917-
sub = process.stdout.transform(utf8.decoder).listen((event) async {
918-
if (event.contains(dartVMServiceRegExp)) {
919-
uri = dartVMServiceRegExp.firstMatch(event)!.group(1)!;
920-
await sub.cancel();
921-
completer.complete();
922-
}
923-
});
924-
925-
// Wait for process to start.
926-
await completer.future;
927-
final client = HttpClient();
928-
929-
Future<String> makeServiceHttpRequest({String method = ''}) async {
930-
var request = await client.getUrl(Uri.parse('$uri$method'));
931-
var response = await request.close();
932-
return await response.transform(utf8.decoder).join();
933-
}
934-
935-
var content = await makeServiceHttpRequest();
936-
const observatoryText = 'Dart VM Observatory';
937-
expect(content.contains(observatoryText), serve);
938-
if (!serve) {
939-
if (withDds) {
940-
expect(content.contains('DevTools'), true);
941-
} else {
942-
expect(
943-
content,
944-
'This VM does not have a registered Dart '
945-
'Development Service (DDS) instance and is not currently serving '
946-
'Dart DevTools.',
947-
);
948-
}
949-
}
950-
951-
// Ensure we can always make VM service requests via HTTP.
952-
content = await makeServiceHttpRequest(method: 'getVM');
953-
expect(content.contains('"jsonrpc":"2.0"'), true);
954-
955-
// If Observatory isn't being served, ensure we can enable it.
956-
if (!serve) {
957-
content = await makeServiceHttpRequest(method: '_serveObservatory');
958-
expect(content.contains('"type":"Success"'), true);
959-
960-
// Ensure Observatory is now being served.
961-
content = await makeServiceHttpRequest();
962-
expect(content.contains(observatoryText), true);
963-
}
964-
965-
process.kill();
966-
},
967-
);
968-
}
969-
970-
const flags = <bool>[true, false];
971-
// TODO(jcollins): Disabling serving no longer seems to produce
972-
// the expected output. Maybe this is because the web interface has
973-
// changed?
974-
for (final serve in [true]) {
975-
for (final enableAuthCodes in flags) {
976-
for (final explicitRun in flags) {
977-
for (final withDds in flags) {
978-
generateServedTest(
979-
serve: serve,
980-
enableAuthCodes: enableAuthCodes,
981-
explicitRun: explicitRun,
982-
withDds: withDds,
983-
);
984-
}
985-
}
986-
}
987-
}
988-
});
989888
}
990889

991890
void residentRun() {

pkg/dartdev/test/smoke/invalid_smoke_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void main() {
5050
],
5151
);
5252
expect(result.exitCode, 64);
53-
expect(result.stdout, contains('Observatory listening'));
53+
expect(result.stdout, contains('The Dart VM service is listening'));
5454
expect(
5555
result.stderr,
5656
contains(
@@ -100,7 +100,7 @@ void main() {
100100
],
101101
);
102102
expect(result.exitCode, 254);
103-
expect(result.stdout, contains('Observatory listening'));
103+
expect(result.stdout, contains('The Dart VM service is listening'));
104104
expect(
105105
result.stderr,
106106
contains(

pkg/dds/test/devtools_observatory_connection_test.dart

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void main() {
3535

3636
defineTest({required bool authCodesEnabled}) {
3737
test(
38-
'Ensure Observatory and DevTools assets are available with '
38+
'Ensure DevTools assets are available with '
3939
'${authCodesEnabled ? '' : 'no'} auth codes', () async {
4040
dds = await DartDevelopmentService.startDartDevelopmentService(
4141
remoteVmServiceUri,
@@ -48,14 +48,6 @@ void main() {
4848

4949
final client = HttpClient();
5050

51-
// Check that Observatory assets are accessible.
52-
final observatoryRequest = await client.getUrl(dds!.uri!);
53-
final observatoryResponse = await observatoryRequest.close();
54-
expect(observatoryResponse.statusCode, 200);
55-
final observatoryContent =
56-
await observatoryResponse.transform(utf8.decoder).join();
57-
expect(observatoryContent, startsWith('<!DOCTYPE html>'));
58-
5951
// Check that DevTools assets are accessible.
6052
final devtoolsRequest = await client.getUrl(dds!.devToolsUri!);
6153
final devtoolsResponse = await devtoolsRequest.close();

0 commit comments

Comments
 (0)