Skip to content

Conversation

digeff
Copy link
Contributor

@digeff digeff commented Oct 25, 2019

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.

@roblourens roblourens mentioned this pull request Oct 25, 2019
8 tasks

export type HighResolutionTime = [number, number];

export function calculateElapsedTime(startProcessingTime: HighResolutionTime): number {
Copy link
Member

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?

Copy link
Contributor Author

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.

// 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;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed

@roblourens roblourens merged commit 1bcbf82 into microsoft:master Oct 30, 2019
@digeff digeff deleted the new_telemetry branch October 31, 2019 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants