Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #126 from Microsoft/jeyou/client-telemetry
Browse files Browse the repository at this point in the history
Track whether CLC or EXE is being used for TFVC
  • Loading branch information
jpricket authored Feb 23, 2017
2 parents 3d2e076 + 5d2e6f4 commit 0f567bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/extensionmanager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export class ExtensionManager implements Disposable {
//If Logging is enabled, the user must have used the extension before so we can enable
//it here. This will allow us to log errors when we begin processing TFVC commands.
this._settings = new Settings();
Telemetry.Initialize(this._settings); //We don't have the serverContext just yet
this.logStart(this._settings.LoggingLevel, workspace.rootPath);
this._teamServicesStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 100);

Expand All @@ -196,10 +197,7 @@ export class ExtensionManager implements Disposable {
//Now that we have a server context, we can update it on the repository context
RepositoryContextFactory.UpdateRepositoryContext(this._repoContext, this._serverContext);

//We need to be able to send feedback even if we aren't authenticated with the server
Telemetry.Initialize(this._settings); //We don't have the serverContext just yet
this._feedbackClient = new FeedbackClient();

this._credentialManager = new CredentialManager();
let accountSettings = new AccountSettings(this._serverContext.RepoInfo.Account);

Expand Down
2 changes: 2 additions & 0 deletions src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export class TfvcTelemetryEvents {
static Status: string = TfvcTelemetryEvents.TelemetryPrefix + "status";
static StartUp: string = TfvcTelemetryEvents.TelemetryPrefix + "startup";
static Sync: string = TfvcTelemetryEvents.TelemetryPrefix + "sync";
static UsingClc: string = TfvcTelemetryEvents.TelemetryPrefix + "clc";
static UsingExe: string = TfvcTelemetryEvents.TelemetryPrefix + "exe";
}

export class WellKnownRepositoryTypes {
Expand Down
5 changes: 5 additions & 0 deletions src/tfvc/tfvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { Repository } from "./repository";
import { TfvcSettings } from "./tfvcsettings";
import { TfvcVersion } from "./tfvcversion";
import { TfvcOutput } from "./tfvcoutput";
import { Telemetry } from "../services/telemetry";
import { TfvcTelemetryEvents } from "../helpers/constants";

var _ = require("underscore");
import * as fs from "fs";
Expand Down Expand Up @@ -63,6 +65,9 @@ export class Tfvc {
this._isExe = path.extname(this._tfvcPath) === ".exe";
if (this._isExe) {
this._minVersion = "14.0.0"; //Minimum tf.exe version
Telemetry.SendEvent(TfvcTelemetryEvents.UsingExe);
} else {
Telemetry.SendEvent(TfvcTelemetryEvents.UsingClc);
}
} else {
Logger.LogWarning(`TFVC ${this._tfvcPath} does not exist.`);
Expand Down

0 comments on commit 0f567bf

Please sign in to comment.