Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 106dee9

Browse files
committed
Tweak the metrics names some more
1 parent 2d049ac commit 106dee9

File tree

7 files changed

+47
-49
lines changed

7 files changed

+47
-49
lines changed

src/GitHub.Api/Metrics/IUsageTracker.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ public interface IUsageTracker
55
bool Enabled { get; set; }
66
void IncrementNumberOfStartups();
77
void IncrementChangesViewButtonCommit();
8-
void IncrementHistoryViewToolbarButtonFetch();
9-
void IncrementHistoryViewToolbarButtonPush();
10-
void IncrementHistoryViewToolbarButtonPull();
8+
void IncrementHistoryViewToolbarFetch();
9+
void IncrementHistoryViewToolbarPush();
10+
void IncrementHistoryViewToolbarPull();
1111
void IncrementAuthenticationViewButtonAuthentication();
1212
void IncrementProjectsInitialized();
1313
void IncrementBranchesViewButtonCreateBranch();
1414
void IncrementBranchesViewButtonDeleteBranch();
1515
void IncrementBranchesViewButtonCheckoutLocalBranch();
1616
void IncrementBranchesViewButtonCheckoutRemoteBranch();
17-
void IncrementSettingsViewUnlockButtonLfsUnlock();
18-
void IncrementAssetExplorerContextMenuLfsLock();
19-
void IncrementAssetExplorerContextMenuLfsUnlock();
17+
void IncrementSettingsViewButtonLfsUnlock();
18+
void IncrementUnityProjectViewContextLfsLock();
19+
void IncrementUnityProjectViewContextLfsUnlock();
2020
}
2121
}

src/GitHub.Api/Metrics/UsageModel.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ public class Dimensions
2727
public class Measures
2828
{
2929
public int NumberOfStartups { get; set; }
30-
public int ChangesViewButtonCommit { get; set; }
31-
public int HistoryViewToolbarButtonFetch { get; set; }
32-
public int HistoryViewToolbarButtonPush { get; set; }
33-
public int HistoryViewToolbarButtonPull { get; set; }
3430
public int ProjectsInitialized { get; set; }
31+
public int ChangesViewButtonCommit { get; set; }
32+
public int HistoryViewToolbarFetch { get; set; }
33+
public int HistoryViewToolbarPush { get; set; }
34+
public int HistoryViewToolbarPull { get; set; }
3535
public int AuthenticationViewButtonAuthentication { get; set; }
3636
public int BranchesViewButtonCreateBranch { get; set; }
3737
public int BranchesViewButtonDeleteBranch { get; set; }
3838
public int BranchesViewButtonCheckoutLocalBranch { get; set; }
3939
public int BranchesViewButtonCheckoutRemoteBranch { get; set; }
40-
public int SettingsViewUnlockButtonLfsUnlock { get; set; }
41-
public int AssetExplorerContextMenuLfsLock { get; set; }
42-
public int AssetExplorerContextMenuLfsUnlock { get; set; }
40+
public int SettingsViewButtonLfsUnlock { get; set; }
41+
public int UnityProjectViewContextLfsLock { get; set; }
42+
public int UnityProjectViewContextLfsUnlock { get; set; }
4343
}
4444

4545
class UsageModel

src/GitHub.Api/Metrics/UsageTracker.cs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
using System.Linq;
33
using System.Text;
44
using System.Threading.Tasks;
5-
using System.Timers;
6-
using System.Globalization;
75
using System.Threading;
86
using Timer = System.Threading.Timer;
97
using GitHub.Logging;
@@ -121,6 +119,14 @@ public void IncrementNumberOfStartups()
121119
usageLoader.Save(usage);
122120
}
123121

122+
public void IncrementProjectsInitialized()
123+
{
124+
var usage = usageLoader.Load(userId);
125+
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
126+
.ProjectsInitialized++;
127+
usageLoader.Save(usage);
128+
}
129+
124130
public void IncrementChangesViewButtonCommit()
125131
{
126132
var usage = usageLoader.Load(userId);
@@ -129,27 +135,27 @@ public void IncrementChangesViewButtonCommit()
129135
usageLoader.Save(usage);
130136
}
131137

132-
public void IncrementHistoryViewToolbarButtonFetch()
138+
public void IncrementHistoryViewToolbarFetch()
133139
{
134140
var usage = usageLoader.Load(userId);
135141
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
136-
.HistoryViewToolbarButtonFetch++;
142+
.HistoryViewToolbarFetch++;
137143
usageLoader.Save(usage);
138144
}
139145

140-
public void IncrementHistoryViewToolbarButtonPush()
146+
public void IncrementHistoryViewToolbarPush()
141147
{
142148
var usage = usageLoader.Load(userId);
143149
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
144-
.HistoryViewToolbarButtonPush++;
150+
.HistoryViewToolbarPush++;
145151
usageLoader.Save(usage);
146152
}
147153

148-
public void IncrementProjectsInitialized()
154+
public void IncrementHistoryViewToolbarPull()
149155
{
150156
var usage = usageLoader.Load(userId);
151157
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
152-
.ProjectsInitialized++;
158+
.HistoryViewToolbarPull++;
153159
usageLoader.Save(usage);
154160
}
155161

@@ -185,43 +191,35 @@ public void IncrementBranchesViewButtonCheckoutRemoteBranch()
185191
usageLoader.Save(usage);
186192
}
187193

188-
public void IncrementSettingsViewUnlockButtonLfsUnlock()
194+
public void IncrementSettingsViewButtonLfsUnlock()
189195
{
190196
var usage = usageLoader.Load(userId);
191197
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
192-
.SettingsViewUnlockButtonLfsUnlock++;
198+
.SettingsViewButtonLfsUnlock++;
193199
usageLoader.Save(usage);
194200
}
195201

196-
public void IncrementAssetExplorerContextMenuLfsLock()
197-
{
198-
var usage = usageLoader.Load(userId);
199-
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
200-
.AssetExplorerContextMenuLfsLock++;
201-
usageLoader.Save(usage);
202-
}
203-
204-
public void IncrementAssetExplorerContextMenuLfsUnlock()
202+
public void IncrementAuthenticationViewButtonAuthentication()
205203
{
206204
var usage = usageLoader.Load(userId);
207205
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
208-
.AssetExplorerContextMenuLfsUnlock++;
206+
.AuthenticationViewButtonAuthentication++;
209207
usageLoader.Save(usage);
210208
}
211209

212-
public void IncrementHistoryViewToolbarButtonPull()
210+
public void IncrementUnityProjectViewContextLfsLock()
213211
{
214212
var usage = usageLoader.Load(userId);
215213
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
216-
.HistoryViewToolbarButtonPull++;
214+
.UnityProjectViewContextLfsLock++;
217215
usageLoader.Save(usage);
218216
}
219217

220-
public void IncrementAuthenticationViewButtonAuthentication()
218+
public void IncrementUnityProjectViewContextLfsUnlock()
221219
{
222220
var usage = usageLoader.Load(userId);
223221
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
224-
.AuthenticationViewButtonAuthentication++;
222+
.UnityProjectViewContextLfsUnlock++;
225223
usageLoader.Save(usage);
226224
}
227225

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/HistoryView.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ private void Pull()
696696
.FinallyInUI((success, e) => {
697697
if (success)
698698
{
699-
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarButtonPull);
699+
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarPull);
700700

701701
EditorUtility.DisplayDialog(Localization.PullActionTitle,
702702
String.Format(Localization.PullSuccessDescription, currentRemoteName),
@@ -720,7 +720,7 @@ private void Push()
720720
.FinallyInUI((success, e) => {
721721
if (success)
722722
{
723-
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarButtonPush);
723+
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarPush);
724724

725725
EditorUtility.DisplayDialog(Localization.PushActionTitle,
726726
String.Format(Localization.PushSuccessDescription, currentRemoteName),
@@ -743,7 +743,7 @@ private void Fetch()
743743
.FinallyInUI((success, e) => {
744744
if (!success)
745745
{
746-
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarButtonFetch);
746+
TaskManager.Run(UsageTracker.IncrementHistoryViewToolbarFetch);
747747

748748
EditorUtility.DisplayDialog(FetchActionTitle, FetchFailureDescription,
749749
Localization.Ok);

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static void ContextMenu_Lock()
111111
{
112112
if (success)
113113
{
114-
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsLock);
114+
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementUnityProjectViewContextLfsLock);
115115
}
116116

117117
isBusy = false;
@@ -157,7 +157,7 @@ private static void ContextMenu_Unlock()
157157
{
158158
if (success)
159159
{
160-
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementAssetExplorerContextMenuLfsUnlock);
160+
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementUnityProjectViewContextLfsUnlock);
161161
}
162162
isBusy = false;
163163
Selection.activeGameObject = null;

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/SettingsView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private void OnGitLfsLocksGUI()
293293
if (GUILayout.Button("Unlock"))
294294
{
295295
Repository.ReleaseLock(lck.Path, true)
296-
.Then(UsageTracker.IncrementSettingsViewUnlockButtonLfsUnlock)
296+
.Then(UsageTracker.IncrementSettingsViewButtonLfsUnlock)
297297
.Start();
298298
}
299299
}

src/tests/IntegrationTests/Metrics/MetricsTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ namespace IntegrationTests
1212
[TestFixture]
1313
class MetricsTests : BaseIntegrationTest
1414
{
15-
[TestCase(nameof(Measures.AssetExplorerContextMenuLfsLock))]
16-
[TestCase(nameof(Measures.AssetExplorerContextMenuLfsUnlock))]
15+
[TestCase(nameof(Measures.UnityProjectViewContextLfsLock))]
16+
[TestCase(nameof(Measures.UnityProjectViewContextLfsUnlock))]
1717
[TestCase(nameof(Measures.AuthenticationViewButtonAuthentication))]
1818
[TestCase(nameof(Measures.BranchesViewButtonCheckoutLocalBranch))]
1919
[TestCase(nameof(Measures.BranchesViewButtonCheckoutRemoteBranch))]
2020
[TestCase(nameof(Measures.BranchesViewButtonCreateBranch))]
2121
[TestCase(nameof(Measures.BranchesViewButtonDeleteBranch))]
2222
[TestCase(nameof(Measures.ChangesViewButtonCommit))]
23-
[TestCase(nameof(Measures.HistoryViewToolbarButtonFetch))]
24-
[TestCase(nameof(Measures.HistoryViewToolbarButtonPull))]
25-
[TestCase(nameof(Measures.HistoryViewToolbarButtonPush))]
23+
[TestCase(nameof(Measures.HistoryViewToolbarFetch))]
24+
[TestCase(nameof(Measures.HistoryViewToolbarPull))]
25+
[TestCase(nameof(Measures.HistoryViewToolbarPush))]
2626
[TestCase(nameof(Measures.NumberOfStartups))]
2727
[TestCase(nameof(Measures.ProjectsInitialized))]
28-
[TestCase(nameof(Measures.SettingsViewUnlockButtonLfsUnlock))]
28+
[TestCase(nameof(Measures.SettingsViewButtonLfsUnlock))]
2929
public void IncrementMetricsWorks(string measureName)
3030
{
3131
var userId = Guid.NewGuid().ToString();

0 commit comments

Comments
 (0)