当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript telemetry.emitTelemetry函数代码示例

本文整理汇总了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} )`);
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:11,代码来源:twineauthenticatemain.ts

示例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} )`);
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:48,代码来源:npm.ts

示例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} )`);
    }
}
开发者ID:shubham90,项目名称:vsts-tasks,代码行数:17,代码来源:universalmain.ts

示例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} )`);
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:69,代码来源:nugetcommandmain.ts

示例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} )`);
    }
}
开发者ID:bleissem,项目名称:vsts-tasks,代码行数:69,代码来源:nugetcommandmain.ts


注:本文中的utility-common/telemetry.emitTelemetry函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。