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

Commit e37842f

Browse files
committed
Starting on metrics
1 parent 2f0753f commit e37842f

File tree

6 files changed

+75
-2
lines changed

6 files changed

+75
-2
lines changed

GitHubVS.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25029.0
4+
VisualStudioVersion = 14.0.25123.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHub.VisualStudio", "src\GitHub.VisualStudio\GitHub.VisualStudio.csproj", "{11569514-5AE5-4B5B-92A2-F10B0967DE5F}"
77
EndProject

script

src/GitHub.App/GitHub.App.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@
113113
<None Include="..\..\script\Key.snk" Condition="$(Buildtype) == 'Internal'">
114114
<Link>Key.snk</Link>
115115
</None>
116+
<Compile Include="..\..\script\MetricsService.cs">
117+
<Link>Services\MetricsService.cs</Link>
118+
</Compile>
116119
<Compile Include="Caches\CacheIndex.cs" />
117120
<Compile Include="Caches\CacheItem.cs" />
118121
<Compile Include="Caches\ImageCache.cs" />

src/GitHub.Exports.Reactive/GitHub.Exports.Reactive.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
<Compile Include="Models\IAvatarContainer.cs" />
8888
<Compile Include="Models\IConnectionRepositoryHostMap.cs" />
8989
<Compile Include="Models\IRepositoryHosts.cs" />
90+
<Compile Include="Models\UsageModel.cs" />
91+
<Compile Include="Services\IMetricsService.cs" />
9092
<Compile Include="Services\IModelService.cs" />
9193
<Compile Include="Services\NotificationDispatcher.cs" />
9294
<Compile Include="ViewModels\ILoginControlViewModel.cs" />
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
3+
namespace GitHub.Models
4+
{
5+
public class UsageModel
6+
{
7+
public bool IsGitHubUser { get; set; }
8+
public bool IsEnterpriseUser { get; set; }
9+
public bool InstalledCommandLineTools { get; set; }
10+
public int NumberOfRepositories { get; set; }
11+
public int NumberOfGitHubRepositories { get; set; }
12+
public int NumberOfGitHubForks { get; set; }
13+
public int NumberOfOrgs { get; set; }
14+
public int NumberOfCommits { get; set; }
15+
public int NumberOfClones { get; set; }
16+
public int NumberOfSyncs { get; set; }
17+
public string AppVersion { get; set; }
18+
public string Lang { get; set; }
19+
// I know you want to rename this to OSVersion. Resist the urge, this is convention based
20+
// pascal to camel case.
21+
public string OsVersion { get; set; }
22+
public bool Is64BitOperatingSystem { get; set; }
23+
public int RamMB { get; set; }
24+
public int NumberOfStartups { get; set; }
25+
public int NumberOfStartupsWeek { get; set; }
26+
public int NumberOfStartupsMonth { get; set; }
27+
public int NumberOfPartialCommits { get; set; }
28+
public int NumberOfTutorialRuns { get; set; }
29+
public int NumberOfOpenOnDisks { get; set; }
30+
public int NumberOfOpenInShells { get; set; }
31+
public int SecondsSinceLaunch { get; set; }
32+
public int NumberOfRepositoryOwners { get; set; }
33+
public int NumberOfBranchSwitches { get; set; }
34+
public int NumberOfDiscardChanges { get; set; }
35+
public int NumberOfOpenedURLs { get; set; }
36+
public int NumberOfLFSDiffs { get; set; }
37+
public int NumberOfMergeCommits { get; set; }
38+
public int NumberOfMergeConflicts { get; set; }
39+
public int NumberOfOpenInExternalEditors { get; set; }
40+
public int NumberOfUpstreamPullRequests { get; set; }
41+
}
42+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Reactive;
3+
using GitHub.Models;
4+
5+
namespace GitHub.Services
6+
{
7+
public interface IMetricsService
8+
{
9+
/// <summary>
10+
/// Posts the provided usage model.
11+
/// </summary>
12+
IObservable<Unit> PostUsage(UsageModel model);
13+
14+
/// <summary>
15+
/// Sends an empty request that indicates that the user has chosen to opt out of usage
16+
/// tracking.
17+
/// </summary>
18+
IObservable<Unit> SendOptOut();
19+
20+
/// <summary>
21+
/// Sends an empty request that indicates that the user has chosen to opt back in to
22+
/// usage tracking.
23+
/// </summary>
24+
IObservable<Unit> SendOptIn();
25+
}
26+
}

0 commit comments

Comments
 (0)