SQL Operations Studio Public Preview 1 (0.23) release source code

This commit is contained in:
Karl Burtram
2017-11-09 14:30:27 -08:00
parent b88ecb8d93
commit 3cdac41339
8829 changed files with 759707 additions and 286 deletions

View File

@@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as Platform from 'vs/base/common/platform';
import * as os from 'os';
import { TPromise } from 'vs/base/common/winjs.base';
import * as uuid from 'vs/base/common/uuid';
// {{SQL CARBON EDIT}}
import product from 'vs/platform/node/product';
export const machineIdStorageKey = 'telemetry.machineId';
export const machineIdIpcChannel = 'vscode:machineId';
export function resolveCommonProperties(commit: string, version: string): TPromise<{ [name: string]: string; }> {
const result: { [name: string]: string; } = Object.create(null);
result['sessionID'] = uuid.generateUuid() + Date.now();
result['commitHash'] = commit;
result['version'] = version;
result['common.osVersion'] = os.release();
result['common.platform'] = Platform.Platform[Platform.platform];
result['common.nodePlatform'] = process.platform;
result['common.nodeArch'] = process.arch;
// {{SQL CARBON EDIT}}
result['common.application.name'] = product.nameLong;
// dynamic properties which value differs on each call
let seq = 0;
const startTime = Date.now();
Object.defineProperties(result, {
'timestamp': {
get: () => new Date(),
enumerable: true
},
'common.timesincesessionstart': {
get: () => Date.now() - startTime,
enumerable: true
},
'common.sequence': {
get: () => seq++,
enumerable: true
}
});
return TPromise.as(result);
}