-
Notifications
You must be signed in to change notification settings - Fork 330
Added basic telemetry #54
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
Conversation
|
||
export type HighResolutionTime = [number, number]; | ||
|
||
export function calculateElapsedTime(startProcessingTime: HighResolutionTime): number { |
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.
Is handling nanoseconds overkill? Did we do that before?
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.
Handling nanoseconds is overkill. We did that before.
For CDP because it's a lot of information, we are going to drop the nanoseconds.
For DAP because it's not that much information, and it's already there, we are leaving it as-is.
src/telemetry/telemetryReporter.ts
Outdated
// Next line is a sample path aligned with the regexp parts that recognize it/match it. () is for the capture group | ||
// C : \ foo \ (in.js:) | ||
// C : \ foo\ble \ (fi.ts:) | ||
const extractFileNamePattern = /[A-z]:(?:[\\/][^:]*)+[\\/]([^:]*:)/g; |
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.
I think we need to do this for non-windows paths too.
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.
Good catch. Fixed
Added some basic telemetry.
For DAP because they tend to match with user actions, and they seem to be not a lot of quantity, we send the telemetry events individually.
For CDP we get a lot of operations, so we batch them all together.
/* Sample telemetry:
*
{
"cdp/Target.attachedToTarget": {
"succesful": {
"totalTime": 7,
"maxTime": 4,
"avgTime": 2.3333333333333335,
"count": 3,
"breakdown": {
"time": "[1,2,4]",
}
},
<if there are failures, we'll have a failed: section here>
},
"cdp/Debugger.scriptParsed": {
"succesful": {
"totalTime": 8,
"maxTime": 5,
"avgTime": 4,
"count": 2,
"breakdown": {
"time": "[5,3]"
}
}
},
<etc...>
}
}
*/
This is just the first iteration. At the moment we send all the CDP operations batched telemetry when we disconnect.