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

Commit 216f31b

Browse files
author
Steven Kirk
committed
Add metrics for OAuth and token logins.
1 parent 5d4e499 commit 216f31b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/GitHub.Exports/Models/UsageModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class UsageModel
2121
public int NumberOfOpenInGitHub { get; set; }
2222
public int NumberOfLinkToGitHub { get; set; }
2323
public int NumberOfLogins { get; set; }
24+
public int NumberOfOAuthLogins { get; set; }
25+
public int NumberOfTokenLogins { get; set; }
2426
public int NumberOfPullRequestsOpened { get; set; }
2527
public int NumberOfLocalPullRequestsCheckedOut { get; set; }
2628
public int NumberOfLocalPullRequestPulls { get; set; }

src/GitHub.VisualStudio/Services/ConnectionManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public async Task<IConnection> LogInViaOAuth(HostAddress address, CancellationTo
106106
conns.Add(connection);
107107
await SaveConnections();
108108
await usageTracker.IncrementCounter(x => x.NumberOfLogins);
109+
await usageTracker.IncrementCounter(x => x.NumberOfOAuthLogins);
109110
return connection;
110111
}
111112

@@ -126,6 +127,7 @@ public async Task<IConnection> LogInWithToken(HostAddress address, string token)
126127
conns.Add(connection);
127128
await SaveConnections();
128129
await usageTracker.IncrementCounter(x => x.NumberOfLogins);
130+
await usageTracker.IncrementCounter(x => x.NumberOfTokenLogins);
129131
return connection;
130132
}
131133

0 commit comments

Comments
 (0)