mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)
* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 * fix tests
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
export interface IPropertyData {
|
||||
classification: 'SystemMetaData' | 'CallstackOrException' | 'CustomerContent' | 'PublicNonPersonalData';
|
||||
classification: 'SystemMetaData' | 'CallstackOrException' | 'CustomerContent' | 'PublicNonPersonalData' | 'EndUserPseudonymizedInformation';
|
||||
purpose: 'PerformanceAndHealth' | 'FeatureInsight' | 'BusinessInsight';
|
||||
endpoint?: string;
|
||||
isMeasurement?: boolean;
|
||||
|
||||
@@ -69,20 +69,16 @@ export class TelemetryService implements ITelemetryService {
|
||||
this._commonProperties.then(values => {
|
||||
const isHashedId = /^[a-f0-9]+$/i.test(values['common.machineId']);
|
||||
|
||||
/* __GDPR__
|
||||
"machineIdFallback" : {
|
||||
"usingFallbackGuid" : { "classification": "SystemMetaData", "purpose": "BusinessInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.publicLog('machineIdFallback', { usingFallbackGuid: !isHashedId });
|
||||
type MachineIdFallbackClassification = {
|
||||
usingFallbackGuid: { classification: 'SystemMetaData', purpose: 'BusinessInsight', isMeasurement: true };
|
||||
};
|
||||
this.publicLog2<{ usingFallbackGuid: boolean }, MachineIdFallbackClassification>('machineIdFallback', { usingFallbackGuid: !isHashedId });
|
||||
|
||||
if (config.trueMachineId) {
|
||||
/* __GDPR__
|
||||
"machineIdDisambiguation" : {
|
||||
"correctedMachineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.publicLog('machineIdDisambiguation', { correctedMachineId: config.trueMachineId });
|
||||
type MachineIdDisambiguationClassification = {
|
||||
correctedMachineId: { endPoint: 'MacAddressHash', classification: 'EndUserPseudonymizedInformation', purpose: 'FeatureInsight' };
|
||||
};
|
||||
this.publicLog2<{ correctedMachineId: string }, MachineIdDisambiguationClassification>('machineIdDisambiguation', { correctedMachineId: config.trueMachineId });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,17 +33,17 @@ export const NullTelemetryService = new class implements ITelemetryService {
|
||||
|
||||
export interface ITelemetryAppender {
|
||||
log(eventName: string, data: any): void;
|
||||
dispose(): Promise<any> | undefined;
|
||||
flush(): Promise<any>;
|
||||
}
|
||||
|
||||
export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetryAppender {
|
||||
return {
|
||||
log: (e, d) => appenders.forEach(a => a.log(e, d)),
|
||||
dispose: () => Promise.all(appenders.map(a => a.dispose()))
|
||||
flush: () => Promise.all(appenders.map(a => a.flush()))
|
||||
};
|
||||
}
|
||||
|
||||
export const NullAppender: ITelemetryAppender = { log: () => null, dispose: () => Promise.resolve(null) };
|
||||
export const NullAppender: ITelemetryAppender = { log: () => null, flush: () => Promise.resolve(null) };
|
||||
|
||||
|
||||
export class LogAppender implements ITelemetryAppender {
|
||||
@@ -51,7 +51,7 @@ export class LogAppender implements ITelemetryAppender {
|
||||
private commonPropertiesRegex = /^sessionID$|^version$|^timestamp$|^commitHash$|^common\./;
|
||||
constructor(@ILogService private readonly _logService: ILogService) { }
|
||||
|
||||
dispose(): Promise<any> {
|
||||
flush(): Promise<any> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export class AppInsightsAppender implements ITelemetryAppender {
|
||||
});
|
||||
}
|
||||
|
||||
dispose(): Promise<any> | undefined {
|
||||
flush(): Promise<any> | undefined {
|
||||
if (this._aiClient) {
|
||||
return new Promise(resolve => {
|
||||
this._aiClient!.flush({
|
||||
|
||||
@@ -37,7 +37,7 @@ export class TelemetryAppenderClient implements ITelemetryAppender {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
dispose(): any {
|
||||
flush(): any {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ suite('AIAdapter', () => {
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
adapter.dispose();
|
||||
adapter.flush();
|
||||
});
|
||||
|
||||
test('Simple event', () => {
|
||||
|
||||
@@ -30,7 +30,7 @@ class TestTelemetryAppender implements ITelemetryAppender {
|
||||
return this.events.length;
|
||||
}
|
||||
|
||||
public dispose(): Promise<any> {
|
||||
public flush(): Promise<any> {
|
||||
this.isDisposed = true;
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user