提交 5943b174 编写于 作者: R Ramya Achutha Rao

Stop sending path in telemetry data as it isnt used anywhere

上级 25a0274d
......@@ -41,47 +41,20 @@ export const NullAppender: ITelemetryAppender = { log: () => null };
// --- util
export function anonymize(input: string): string {
if (!input) {
return input;
}
let r = '';
for (let i = 0; i < input.length; i++) {
let ch = input[i];
if (ch >= '0' && ch <= '9') {
r += '0';
continue;
}
if (ch >= 'a' && ch <= 'z') {
r += 'a';
continue;
}
if (ch >= 'A' && ch <= 'Z') {
r += 'A';
continue;
}
r += ch;
}
return r;
}
/* __GDPR__FRAGMENT__
"URIDescriptor" : {
"mimeType" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"ext": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"path": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
"ext": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
export interface URIDescriptor {
mimeType?: string;
ext?: string;
path?: string;
}
export function telemetryURIDescriptor(uri: URI): URIDescriptor {
const fsPath = uri && uri.fsPath;
return fsPath ? { mimeType: guessMimeTypes(fsPath).join(', '), ext: paths.extname(fsPath), path: anonymize(fsPath) } : {};
return fsPath ? { mimeType: guessMimeTypes(fsPath).join(', '), ext: paths.extname(fsPath) } : {};
}
/**
......
......@@ -31,7 +31,6 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { anonymize } from 'vs/platform/telemetry/common/telemetryUtils';
import { RunOnceScheduler } from 'vs/base/common/async';
import { IRawTextSource } from 'vs/editor/common/model/textSource';
......@@ -380,7 +379,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
"path": { "classification": "CustomerContent", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('fileGet', { mimeType: guessMimeTypes(this.resource.fsPath).join(', '), ext: paths.extname(this.resource.fsPath), path: anonymize(this.resource.fsPath) });
this.telemetryService.publicLog('fileGet', { mimeType: guessMimeTypes(this.resource.fsPath).join(', '), ext: paths.extname(this.resource.fsPath) });
}
return model;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册