-
Notifications
You must be signed in to change notification settings - Fork 337
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
Add socket profiling to Network page #2191
Conversation
static const _contentTypeKey = 'content-type'; | ||
static const _cookieKey = 'cookie'; | ||
static const _errorKey = 'error'; | ||
static const _filterKey = 'filterKey'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: normalize the key names. This one has the word Key
in the value but others don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filterKey is actually the name of the key in the arguments map. This would need to be changed on the VM but I think it is actually an accurate description as is because it is describing a key to group events on.
static const _requestHeadersKey = 'requestHeaders'; | ||
static const _responseHeadersKey = 'responseHeaders'; | ||
static const _statusCodeKey = 'statusCode'; | ||
static const _setCookieKey = 'set-cookie'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this key camelCase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps add a TODO and file a bug upstream on the VM to cleanup the names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a TODO and filed a bug. Names need to be changed upstream
@@ -126,46 +131,68 @@ class NetworkController { | |||
invalidRequests.add(requestData); | |||
} | |||
} | |||
return HttpRequests( | |||
|
|||
currentValues.removeWhere((value) => value is WebSocket); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rather than removing all WebSocket, maybe just don't add them in the first place. it looks like we are adding them a couple lines earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, currentValues
contains all the current requests we have in the profiler, which will contain ws requests if they exist. When we refresh the network data after polling, the new data may contain web sockets with the same ids as ones we already have. For this reason, we need to remove the current web sockets and replace with the updated data in the profile. We could be smarter about this and keep unchanged sockets in the list if we need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sg. can you add a comment to that effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses part of #2044 |
This CL
Table with both HTTP and WS requests and overview for selected HTTP request:
![Screen Shot 2020-07-17 at 3 19 06 PM](https://user-images.githubusercontent.com/43759233/87835922-5acd7600-c843-11ea-8154-72a1916ce445.png)
![Screen Shot 2020-07-17 at 1 52 26 PM](https://user-images.githubusercontent.com/43759233/87835967-6620a180-c843-11ea-8ac3-58c1332d6189.png)
Overview for socket:
TODO before submitting: add tests and general cleanup