本文整理匯總了TypeScript中utility-common/telemetry.emitTelemetry函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript emitTelemetry函數的具體用法?TypeScript emitTelemetry怎麽用?TypeScript emitTelemetry使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了emitTelemetry函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _logTwineAuthStartupVariables
// Telemetry
function _logTwineAuthStartupVariables() {
try {
const twineAuthenticateTelemetry = {
"System.TeamFoundationCollectionUri": tl.getVariable("System.TeamFoundationCollectionUri"),
};
telemetry.emitTelemetry("Packaging", "TwineAuthenticate", twineAuthenticateTelemetry);
} catch (err) {
tl.debug(`Unable to log Twine Authenticate task init telemetry. Err:( ${err} )`);
}
}
示例2: _logNpmStartupVariables
async function _logNpmStartupVariables(packagingLocation: pkgLocationUtils.PackagingLocation) {
try {
// Log the NPM version
let version: string;
try {
const syncResult: IExecSyncResult = tl.execSync('npm', '--version');
if (syncResult.stdout) {
version = syncResult.stdout.trim();
}
} catch (err) {
tl.debug(`Unable to get NPM config info. Err:( ${err} )`);
}
// Log the NPM registries
const command = tl.getInput(NpmTaskInput.Command);
let npmRegistriesAry: INpmRegistry[];
const registryUrlAry = [];
switch (command) {
case NpmCommand.Install:
case NpmCommand.Custom:
npmRegistriesAry = await npmCustom.getCustomRegistries(packagingLocation);
break;
case NpmCommand.Publish:
npmRegistriesAry = [await npmPublish.getPublishRegistry(packagingLocation)];
break;
}
for (const registry of npmRegistriesAry) {
registryUrlAry.push(registry.url);
}
const npmTelem = {
'command': command,
'verbose': tl.getInput(NpmTaskInput.Verbose),
'customRegistry': tl.getInput(NpmTaskInput.CustomRegistry),
'customFeed': tl.getInput(NpmTaskInput.CustomFeed),
'customEndpoint': tl.getInput(NpmTaskInput.CustomEndpoint),
'publishRegistry': tl.getInput(NpmTaskInput.PublishRegistry),
'publishFeed': tl.getInput(NpmTaskInput.PublishFeed),
'publishEndpoint': tl.getInput(NpmTaskInput.PublishEndpoint),
'npmVersion': version,
'registries': registryUrlAry
};
telemetry.emitTelemetry('Packaging', 'npm', npmTelem);
} catch (err) {
tl.debug(`Unable to log NPM task telemetry. Err:( ${err} )`);
}
}
示例3: _logUniversalStartupVariables
function _logUniversalStartupVariables(artifactToolPath: string) {
try {
let universalPackagesTelemetry = {
"command": tl.getInput("command"),
"buildProperties": tl.getInput("buildProperties"),
"basePath": tl.getInput("basePath"),
"System.TeamFoundationCollectionUri": tl.getVariable("System.TeamFoundationCollectionUri"),
"verbosity": tl.getInput("verbosity"),
"solution": tl.getInput("solution"),
"artifactToolPath": artifactToolPath,
};
telemetry.emitTelemetry("Packaging", "UniversalPackages", universalPackagesTelemetry);
} catch (err) {
tl.debug(`Unable to log Universal Packages task init telemetry. Err:( ${err} )`);
}
}
示例4: _logNugetStartupVariables
function _logNugetStartupVariables(nuGetPath: string, nugetVersion: string) {
try {
const nugetfeedtype = tl.getInput("nugetfeedtype");
let externalendpoint = null;
if (nugetfeedtype != null && nugetfeedtype === "external") {
const epId = tl.getInput("externalendpoint");
if (epId) {
externalendpoint = {
feedName: tl.getEndpointUrl(epId, false).replace(/\W/g, ""),
feedUri: tl.getEndpointUrl(epId, false),
};
}
}
let externalendpoints = tl.getDelimitedInput("externalendpoints", ",");
if (externalendpoints) {
externalendpoints = externalendpoints.reduce((ary, id) => {
const te = {
feedName: tl.getEndpointUrl(id, false).replace(/\W/g, ""),
feedUri: tl.getEndpointUrl(id, false),
};
ary.push(te);
return ary;
}, []);
}
const nugetTelem = {
"command": tl.getInput("command"),
"NUGET_EXE_TOOL_PATH_ENV_VAR": tl.getVariable(nuGetGetter.NUGET_EXE_TOOL_PATH_ENV_VAR),
"NUGET_EXE_CUSTOM_LOCATION": tl.getVariable(NUGET_EXE_CUSTOM_LOCATION),
"searchPatternPack": tl.getPathInput("searchPatternPack"),
"configurationToPack": tl.getInput("configurationToPack"),
"versioningScheme": tl.getInput("versioningScheme"),
"includeReferencedProjects": tl.getBoolInput("includeReferencedProjects"),
"versionEnvVar": tl.getInput("versioningScheme") === "byEnvVar" ?
tl.getVariable(tl.getInput("versionEnvVar")) : null,
"requestedMajorVersion": tl.getInput("requestedMajorVersion"),
"requestedMinorVersion": tl.getInput("requestedMinorVersion"),
"requestedPatchVersion": tl.getInput("requestedPatchVersion"),
"packTimezone": tl.getInput("packTimezone"),
"buildProperties": tl.getInput("buildProperties"),
"basePath": tl.getInput("basePath"),
"verbosityPack": tl.getInput("verbosityPack"),
"includeSymbols": tl.getBoolInput("includeSymbols"),
"NuGet.UseLegacyFindFiles": tl.getVariable("NuGet.UseLegacyFindFiles"),
"NuGetTasks.IsHostedTestEnvironment": tl.getVariable("NuGetTasks.IsHostedTestEnvironment"),
"System.TeamFoundationCollectionUri": tl.getVariable("System.TeamFoundationCollectionUri"),
"NuGet.OverwritePackagingCollectionUrl": tl.getVariable("NuGet.OverwritePackagingCollectionUrl"),
"externalendpoint": externalendpoint,
"externalendpoints": externalendpoints,
"allowpackageconflicts": tl.getInput("allowpackageconflicts"),
"includenugetorg": tl.getInput("includenugetorg"),
"nocache": tl.getInput("nocache"),
"disableparallelprocessing": tl.getInput("disableParallelProcessing"),
"nugetconfigpath": tl.getInput("nugetconfigpath"),
"nugetfeedtype": nugetfeedtype,
"searchpatternpush": tl.getInput("searchpatternpush"),
"selectorconfig": tl.getInput("selectorconfig"),
"solution": tl.getInput("solution"),
"verbositypush": tl.getInput("verbositypush"),
"verbosityrestore": tl.getInput("verbosityrestore"),
"nuGetPath": nuGetPath,
"nugetVersion": nugetVersion,
};
telemetry.emitTelemetry("Packaging", "NuGetCommand", nugetTelem);
} catch (err) {
tl.debug(`Unable to log NuGet task init telemetry. Err:( ${err} )`);
}
}
示例5: _logNugetStartupVariables
function _logNugetStartupVariables(nuGetPath: string, nugetVersion: string) {
try {
const nugetfeedtype = tl.getInput("nugetfeedtype");
let externalendpoint = null;
if (nugetfeedtype != null && nugetfeedtype === "external") {
const epId = tl.getInput("externalendpoint");
if (epId) {
externalendpoint = {
feedName: tl.getEndpointUrl(epId, false).replace(/\W/g, ''),
feedUri: tl.getEndpointUrl(epId, false),
};
}
}
let externalendpoints = tl.getDelimitedInput('externalendpoints', ',');
if (externalendpoints) {
externalendpoints = externalendpoints.reduce((ary, id) => {
const te = {
feedName: tl.getEndpointUrl(id, false).replace(/\W/g, ''),
feedUri: tl.getEndpointUrl(id, false),
};
ary.push(te);
return ary;
}, []);
}
let nugetTelem = {
'command': tl.getInput('command'),
'NUGET_EXE_TOOL_PATH_ENV_VAR': tl.getVariable(nuGetGetter.NUGET_EXE_TOOL_PATH_ENV_VAR),
'NUGET_EXE_CUSTOM_LOCATION': tl.getVariable(NUGET_EXE_CUSTOM_LOCATION),
'searchPatternPack': tl.getPathInput('searchPatternPack'),
'configurationToPack': tl.getInput('configurationToPack'),
'versioningScheme': tl.getInput('versioningScheme'),
'includeReferencedProjects': tl.getBoolInput('includeReferencedProjects'),
'versionEnvVar': tl.getInput('versioningScheme') === 'byEnvVar' ?
tl.getVariable(tl.getInput('versionEnvVar')) : null,
'requestedMajorVersion': tl.getInput('requestedMajorVersion'),
'requestedMinorVersion': tl.getInput('requestedMinorVersion'),
'requestedPatchVersion': tl.getInput('requestedPatchVersion'),
'packTimezone': tl.getInput('packTimezone'),
'buildProperties': tl.getInput('buildProperties'),
'basePath': tl.getInput('basePath'),
'verbosityPack': tl.getInput('verbosityPack'),
'includeSymbols': tl.getBoolInput('includeSymbols'),
'NuGet.UseLegacyFindFiles': tl.getVariable('NuGet.UseLegacyFindFiles'),
'NuGetTasks.IsHostedTestEnvironment': tl.getVariable('NuGetTasks.IsHostedTestEnvironment'),
'System.TeamFoundationCollectionUri': tl.getVariable('System.TeamFoundationCollectionUri'),
'NuGet.OverwritePackagingCollectionUrl': tl.getVariable('NuGet.OverwritePackagingCollectionUrl'),
'externalendpoint': externalendpoint,
'externalendpoints': externalendpoints,
'allowpackageconflicts': tl.getInput('allowpackageconflicts'),
'includenugetorg': tl.getInput('includenugetorg'),
'nocache': tl.getInput('nocache'),
'disableparallelprocessing': tl.getInput('disableParallelProcessing'),
'nugetconfigpath': tl.getInput('nugetconfigpath'),
'nugetfeedtype': nugetfeedtype,
'searchpatternpush': tl.getInput('searchpatternpush'),
'selectorconfig': tl.getInput('selectorconfig'),
'solution': tl.getInput('solution'),
'verbositypush': tl.getInput('verbositypush'),
'verbosityrestore': tl.getInput('verbosityrestore'),
'nuGetPath': nuGetPath,
'nugetVersion': nugetVersion
};
telemetry.emitTelemetry('Packaging', 'NuGetCommand', nugetTelem);
} catch (err) {
tl.debug(`Unable to log NuGet task init telemetry. Err:( ${err} )`);
}
}