Add flags to completions telemetry (#148313)

This commit is contained in:
Andrew Branch
2022-04-30 14:57:13 -07:00
committed by GitHub
parent 19e728a2c0
commit e9e3ca02ef

View File

@@ -818,6 +818,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
"duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "type" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "count" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"flags": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"updateGraphDurationMs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "updateGraphDurationMs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"createAutoImportProviderProgramDurationMs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "createAutoImportProviderProgramDurationMs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"includesPackageJsonImport" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "includesPackageJsonImport" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
@@ -830,6 +831,8 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider<
this.telemetryReporter.logTelemetry('completions.execute', { this.telemetryReporter.logTelemetry('completions.execute', {
duration: String(duration), duration: String(duration),
type: response?.type ?? 'unknown', type: response?.type ?? 'unknown',
// @ts-expect-error until 4.7
flags: response?.type === 'response' && typeof response.body?.flags === 'number' ? String(response.body.flags) : undefined,
count: String(response?.type === 'response' && response.body ? response.body.entries.length : 0), count: String(response?.type === 'response' && response.body ? response.body.entries.length : 0),
updateGraphDurationMs: response?.type === 'response' && typeof response.performanceData?.updateGraphDurationMs === 'number' updateGraphDurationMs: response?.type === 'response' && typeof response.performanceData?.updateGraphDurationMs === 'number'
? String(response.performanceData.updateGraphDurationMs) ? String(response.performanceData.updateGraphDurationMs)