Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vm_service to 11.0.0 and finish profiling migration #5105

Merged
merged 24 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
495f8b8
Improve Network Screen Reliability
CoderDake Jan 17, 2023
bd2757e
add getSocketProfile Todo
CoderDake Jan 17, 2023
5fba64d
Release notes entry
CoderDake Jan 17, 2023
6def85c
fix network table test
CoderDake Jan 19, 2023
c9aa6c5
Merge remote-tracking branch 'origin/master' into dake-2860
CoderDake Jan 19, 2023
d628e4d
Merge remote-tracking branch 'origin/master' into dake-2860
CoderDake Jan 24, 2023
29fd53c
cleanup and testing fixes
CoderDake Jan 24, 2023
f898431
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Jan 24, 2023
0a58a65
cleanup non id changes
CoderDake Jan 24, 2023
2cde461
test fix
CoderDake Jan 24, 2023
df07dbc
magical format fix
CoderDake Jan 25, 2023
9788105
Cleanup
CoderDake Jan 25, 2023
fe7feca
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Jan 25, 2023
407e572
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Feb 6, 2023
9ab965d
back to original ids
CoderDake Feb 6, 2023
190d670
address todos, and cleanup from fugue state
CoderDake Feb 6, 2023
2aad452
update to override vm_service:11.0.0
CoderDake Feb 6, 2023
292f31f
Temporary measures until versions are updated
CoderDake Feb 6, 2023
e4d051e
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Feb 7, 2023
044f984
finalize pubspecs
CoderDake Feb 7, 2023
48b6040
remove redundancy on string conversion from WebSocker
CoderDake Feb 8, 2023
5c413e8
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Feb 8, 2023
fd45c59
Merge remote-tracking branch 'origin/master' into network-id-migration
CoderDake Feb 21, 2023
bb21c5d
remove deprecated accentColor
CoderDake Feb 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class MyGetHttpDataState extends State<MyGetHttpData> {
preferredSize: const Size.fromHeight(48.0),
child: Theme(
// ignore: deprecated_member_use
data: Theme.of(context).copyWith(accentColor: Colors.white),
data: Theme.of(context),
child: Container(
height: 48.0,
alignment: Alignment.center,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class WebSocket extends NetworkRequest {

final SocketStatistic _socket;
@override
String get id => _socket.id.toString();
String get id => _socket.id;

@override
Duration? get duration {
Expand Down
30 changes: 4 additions & 26 deletions packages/devtools_app/lib/src/service/vm_service_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import 'dart:async';
import 'package:collection/collection.dart' show IterableExtension;
import 'package:dds_service_extensions/dds_service_extensions.dart';
import 'package:flutter/foundation.dart';
// TODO(CoderDake): remove after migration to vm_service:11.0.0
// ignore: implementation_imports
import 'package:vm_service/src/vm_service.dart';
import 'package:vm_service/vm_service.dart';

import '../screens/vm_developer/vm_service_private_extensions.dart';
Expand Down Expand Up @@ -856,29 +853,10 @@ class VmServiceWrapper implements VmService {
String id,
) async {
assert(await isHttpProfilingAvailable(isolateId));
final dartIOVersion = await getDartIOVersion(isolateId);
final majorVersion = dartIOVersion.major;
// TODO(CoderDake): switch back to _vmService.getHttpProfileRequest call
// when upgrading to vm_service:11.0.0
if (majorVersion == null || majorVersion < 2) {
return trackFuture(
'ext.dart.io.getHttpProfileRequest',
extensionCallHelper(
_vmService, 'ext.dart.io.getHttpProfileRequest', <String, dynamic>{
'id': int.parse(id),
'isolateId': isolateId,
}),
).then((r) => r as HttpProfileRequest);
} else {
return trackFuture(
'ext.dart.io.getHttpProfileRequest',
extensionCallHelper(
_vmService, 'ext.dart.io.getHttpProfileRequest', <String, dynamic>{
'id': id,
'isolateId': isolateId,
}),
).then((r) => r as HttpProfileRequest);
}
return trackFuture(
'getHttpProfileRequest',
_vmService.getHttpProfileRequest(isolateId, id),
);
}

/// The `clearHttpProfile` RPC is used to clear previously recorded HTTP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DartIOHttpRequestData extends NetworkRequest {
return serviceManager.service!
.getHttpProfileRequest(
_request.isolateId,
_request.id.toString(),
_request.id,
)
.then((updated) => _request = updated);
}
Expand All @@ -71,7 +71,7 @@ class DartIOHttpRequestData extends NetworkRequest {
}

@override
String get id => _request.id.toString();
String get id => _request.id;

bool get _hasError => _request.request?.hasError ?? false;

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies:
string_scanner: ^1.1.0
url_launcher: ^6.1.0
url_launcher_web: ^2.0.6
vm_service: ^10.1.0
vm_service: ^11.0.0
vm_snapshot_analysis: ^0.7.1
web_socket_channel: ^2.1.0
# widget_icons: ^0.0.1
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/test/http/curl_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ DartIOHttpRequestData _testDartIOHttpRequestData({
return _TestDartIOHttpRequestData(
0,
HttpProfileRequest(
id: 0,
id: '0',
isolateId: '0',
method: method,
uri: uri,
Expand Down
20 changes: 10 additions & 10 deletions packages/devtools_app/test/test_infra/test_data/network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ final httpGetResponseBodyData = [

final testSocket1 = WebSocket(SocketStatistic.parse(testSocket1Json)!, 0);
final Map<String, dynamic> testSocket1Json = {
'id': 0,
'id': '0',
'startTime': 1000000,
'endTime': 2000000,
'lastReadTime': 1800000,
Expand All @@ -88,7 +88,7 @@ final Map<String, dynamic> testSocket1Json = {

final testSocket2 = WebSocket(SocketStatistic.parse(testSocket2Json)!, 0);
final Map<String, dynamic> testSocket2Json = {
'id': 1,
'id': '1',
'startTime': 3000000,
// This socket has no end time.
'lastReadTime': 3500000,
Expand All @@ -102,7 +102,7 @@ final Map<String, dynamic> testSocket2Json = {

final testSocket3 = WebSocket(SocketStatistic.parse(testSocket3Json)!, 0);
final Map<String, dynamic> testSocket3Json = {
'id': 0,
'id': '0',
'startTime': 1000000,
'endTime': 2000000,
'lastReadTime': 1800000,
Expand All @@ -122,7 +122,7 @@ final httpGet = DartIOHttpRequestData(
);
final Map<String, dynamic> httpGetJson = {
'type': 'HttpProfileRequest',
'id': 1,
'id': '1',
'isolateId': 'isolates/2013291945734727',
'method': 'GET',
'uri': 'https://jsonplaceholder.typicode.com/albums/1',
Expand Down Expand Up @@ -188,7 +188,7 @@ final httpPost = DartIOHttpRequestData(
);
final Map<String, dynamic> httpPostJson = {
'type': 'HttpProfileRequest',
'id': 2,
'id': '2',
'isolateId': 'isolates/979700762893215',
'method': 'POST',
'uri': 'https://jsonplaceholder.typicode.com/posts',
Expand Down Expand Up @@ -265,7 +265,7 @@ final httpPut = DartIOHttpRequestData(
);
final Map<String, dynamic> httpPutJson = {
'type': 'HttpProfileRequest',
'id': 3,
'id': '3',
'isolateId': 'isolates/4447876918484683',
'method': 'PUT',
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
Expand Down Expand Up @@ -344,7 +344,7 @@ final httpPatch = DartIOHttpRequestData(
);
final Map<String, dynamic> httpPatchJson = {
'type': 'HttpProfileRequest',
'id': 4,
'id': '4',
'isolateId': 'isolates/4447876918484683',
'method': 'PATCH',
'uri': 'https://jsonplaceholder.typicode.com/posts/1',
Expand Down Expand Up @@ -426,7 +426,7 @@ final httpGetWithError = DartIOHttpRequestData(
);
final Map<String, dynamic> httpGetWithErrorJson = {
'type': '@HttpProfileRequest',
'id': 5,
'id': '5',
'isolateId': 'isolates/1939772779732043',
'method': 'GET',
'uri': 'https://www.examplez.com/1',
Expand All @@ -446,7 +446,7 @@ final httpWsHandshake = DartIOHttpRequestData(
);
final Map<String, dynamic> httpWsHandshakeJson = {
'type': 'HttpProfileRequest',
'id': 6,
'id': '6',
'isolateId': 'isolates/1350291957483171',
'method': 'GET',
'uri': 'http://localhost:8080',
Expand Down Expand Up @@ -512,7 +512,7 @@ final httpGetPending = DartIOHttpRequestData(
);
final Map<String, dynamic> httpGetPendingJson = {
'type': 'HttpProfileRequest',
'id': 7,
'id': '7',
'isolateId': 'isolates/2013291945734727',
'method': 'GET',
'uri': 'https://jsonplaceholder.typicode.com/albums/10',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class FakeVmServiceWrapper extends Fake implements VmServiceWrapper {
final httpProfile = await getHttpProfile(isolateId);
return Future.value(
httpProfile.requests
.firstWhereOrNull((request) => request.id.toString() == id),
.firstWhereOrNull((request) => request.id == id),
);
}

Expand Down