Add project telemetry#16050
Conversation
| * Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed. | ||
| * Also converts enum values back to strings. | ||
| */ | ||
| export function convertCompilerOptionsForTelemetry(opts: ts.CompilerOptions): ts.CompilerOptions { |
| readonly dts: number; | ||
| } | ||
|
|
||
| function getFileStats(fileNames: string[]): FileStats { |
There was a problem hiding this comment.
why not just use countEachFileTypes
|
We also should add the new event in protocol.ts |
|
protocol.ts already has a "telemetry" event, should we use that? Or change the event name to "projectTelemetry"? |
i would add a new one. @mjbvz any preferences here? |
|
@Andy-MS we should also set |
| @@ -1029,9 +1037,19 @@ namespace ts.server { | |||
| const data: ProjectInfoTelemetryEventData = { | |||
There was a problem hiding this comment.
for completeness lets also include include, exclude and compileOnSave
|
@mhegazy It may be more consistent to stick with a single |
| export interface ProjectInfoTypeAcquisitionData { | ||
| readonly enable: boolean; | ||
| // Actual values of include/exclude entries are scrubbed. | ||
| readonly include: Array<"">; |
There was a problem hiding this comment.
should not this be like include and exclude and be boolean | undefined?
There was a problem hiding this comment.
In contrast to a tsconfig "include", typeAcquisition include can apparently be provided by an external config. It also appears to be getting automatically set to an empty array if not explicitly provided.
We could make it be a boolean that is equal to whether the array is non-empty though.
mhegazy
left a comment
There was a problem hiding this comment.
Just one comment about typingsOptions.include and typingsOptions.exclude.
|
A few more pieces of info that just came to mind:
|
| readonly typeAcquisition: ProjectInfoTypeAcquisitionData; | ||
|
|
||
| /** Is 'undefined' if config file name is not tsconfig or jsconfig. */ | ||
| readonly configFileName: "tsconfig.json" | "jsconfig.json" | undefined; |
There was a problem hiding this comment.
undefined is not going to survive in the json serialization. consider adding "other" value.
This adds a telemetry event the first time a project is opened in a session.
The event contains a count of files by extension and scrubbed compiler options.