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

Commit 916e2fd

Browse files
committed
Add NumberOfClonesToDefaultClonePath counter
Add a counter to record the number of times a repository is cloned to the DefaultClonePath. This will give us an idea of how often users bother to change this default and what impact it has on usage.
1 parent efe148d commit 916e2fd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ public async Task CloneRepository(
135135
// If it isn't a GitHub URL, assume it's an Enterprise URL
136136
await usageTracker.IncrementCounter(x => x.NumberOfEnterpriseClones);
137137
}
138+
139+
if (repositoryPath.StartsWith(DefaultClonePath, StringComparison.OrdinalIgnoreCase))
140+
{
141+
// Count the number of times users clone into the Default Repository Location
142+
await usageTracker.IncrementCounter(x => x.NumberOfClonesToDefaultClonePath);
143+
}
138144
}
139145
catch (Exception ex)
140146
{

src/GitHub.Exports/Models/UsageModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public class MeasuresModel
9191
public int NumberOfCloneViewUrlTab { get; set; }
9292
public int NumberOfGitHubClones { get; set; }
9393
public int NumberOfEnterpriseClones { get; set; }
94+
public int NumberOfClonesToDefaultClonePath { get; set; }
9495
}
9596
}
9697
}

0 commit comments

Comments
 (0)