Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 477407e

Browse files
committed
Add ExecuteToggleInlineCommentMarginCommand metric
This counter is incremented when the ToggleInlineCommentMarginCommand is executed.
1 parent b601462 commit 477407e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/GitHub.Exports/Models/UsageModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public class MeasuresModel
7171
public int NumberOfStatusBarOpenPullRequestList { get; set; }
7272
public int NumberOfTeamExplorerHomeOpenPullRequestList { get; set; }
7373
public int NumberOfNavigateToPullRequestFileDiff { get; set; }
74+
public int ExecuteToggleInlineCommentMarginCommand { get; set; }
7475
}
7576
}
7677
}

src/GitHub.InlineReviews/Commands/ToggleInlineCommentMarginCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@ public class ToggleInlineCommentMarginCommand : VsCommand, IToggleInlineCommentM
2727

2828
readonly Lazy<IVsTextManager> textManager;
2929
readonly Lazy<IVsEditorAdaptersFactoryService> editorAdapter;
30+
readonly Lazy<IUsageTracker> usageTracker;
3031

3132
[ImportingConstructor]
3233
public ToggleInlineCommentMarginCommand(
3334
IGitHubServiceProvider serviceProvider,
34-
Lazy<IVsEditorAdaptersFactoryService> editorAdapter) : base(CommandSet, CommandId)
35+
Lazy<IVsEditorAdaptersFactoryService> editorAdapter,
36+
Lazy<IUsageTracker> usageTracker) : base(CommandSet, CommandId)
3537
{
3638
textManager = new Lazy<IVsTextManager>(() => serviceProvider.GetService<SVsTextManager, IVsTextManager>());
3739
this.editorAdapter = editorAdapter;
40+
this.usageTracker = usageTracker;
3841
}
3942

4043
public override Task Execute()
4144
{
45+
usageTracker.Value.IncrementCounter(x => x.ExecuteToggleInlineCommentMarginCommand);
46+
4247
IVsTextView activeView = null;
4348
if (textManager.Value.GetActiveView(1, null, out activeView) == VSConstants.S_OK)
4449
{

0 commit comments

Comments
 (0)