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

Commit 6c1afe3

Browse files
Adding metrics for publishing and opening the command line
1 parent 106dee9 commit 6c1afe3

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

src/GitHub.Api/Metrics/IUsageTracker.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ public interface IUsageTracker
1717
void IncrementSettingsViewButtonLfsUnlock();
1818
void IncrementUnityProjectViewContextLfsLock();
1919
void IncrementUnityProjectViewContextLfsUnlock();
20+
void IncrementPublishViewButtonPublish();
21+
void IncrementApplicationMenuMenuItemCommandLine();
2022
}
2123
}

src/GitHub.Api/Metrics/UsageModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class Measures
4040
public int SettingsViewButtonLfsUnlock { get; set; }
4141
public int UnityProjectViewContextLfsLock { get; set; }
4242
public int UnityProjectViewContextLfsUnlock { get; set; }
43+
public int PublishViewButtonPublish { get; set; }
44+
public int ApplicationMenuMenuItemCommandLine { get; set; }
4345
}
4446

4547
class UsageModel

src/GitHub.Api/Metrics/UsageTracker.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ public void IncrementUnityProjectViewContextLfsUnlock()
223223
usageLoader.Save(usage);
224224
}
225225

226+
public void IncrementPublishViewButtonPublish()
227+
{
228+
var usage = usageLoader.Load(userId);
229+
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
230+
.PublishViewButtonPublish++;
231+
usageLoader.Save(usage);
232+
}
233+
234+
public void IncrementApplicationMenuMenuItemCommandLine()
235+
{
236+
var usage = usageLoader.Load(userId);
237+
usage.GetCurrentMeasures(appVersion, unityVersion, instanceId)
238+
.ApplicationMenuMenuItemCommandLine++;
239+
usageLoader.Save(usage);
240+
}
241+
226242
public bool Enabled
227243
{
228244
get

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ public override void OnGUI()
173173
return;
174174
}
175175

176+
TaskManager.Run(UsageTracker.IncrementPublishViewButtonPublish);
177+
176178
if (repository == null)
177179
{
178180
Logger.Warning("Returned Repository is null");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static void Window_GitHub()
5858
public static void GitHub_CommandLine()
5959
{
6060
EntryPoint.ApplicationManager.ProcessManager.RunCommandLineWindow(NPath.CurrentDirectory);
61+
EntryPoint.ApplicationManager.TaskManager.Run(EntryPoint.ApplicationManager.UsageTracker.IncrementApplicationMenuMenuItemCommandLine);
6162
}
6263

6364
#if DEBUG

0 commit comments

Comments
 (0)