-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic Telemetry for File Explorer Source Control Integration feature …
…inside Dev Home (#3484) * proposed telemetry changes for add/remove repository * remove unrequired using statements * address PR feedback * address PR feedback * adjust comment * add count of repos tracked inside Dev Home to event
- Loading branch information
Showing
4 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Diagnostics.Tracing; | ||
using DevHome.Telemetry; | ||
using Microsoft.Diagnostics.Telemetry; | ||
using Microsoft.Diagnostics.Telemetry.Internal; | ||
|
||
namespace DevHome.Common.TelemetryEvents.SourceControlIntegration; | ||
|
||
[EventData] | ||
public class SourceControlIntegrationEvent : EventBase | ||
{ | ||
public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServicePerformance; | ||
|
||
public string RepositoryRootPath | ||
{ | ||
get; | ||
} | ||
|
||
public int TrackedRepositoryCount | ||
{ | ||
get; | ||
} | ||
|
||
public SourceControlIntegrationEvent(string sourceControlProviderClassId, string repositoryRootPath, int trackedRepositoryCount) | ||
{ | ||
RepositoryRootPath = SourceControlIntegrationHelper.GetSafeRootPath(repositoryRootPath); | ||
TrackedRepositoryCount = trackedRepositoryCount; | ||
} | ||
|
||
public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings) | ||
{ | ||
// The only sensitive strings is the repository root path. GetSafeRootPath is used to potentially remove PII and | ||
// keep last part of path. | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
namespace DevHome.Common.TelemetryEvents.SourceControlIntegration; | ||
|
||
public static class SourceControlIntegrationHelper | ||
{ | ||
public static string GetSafeRootPath(string rootPath) | ||
{ | ||
var parts = rootPath.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries); | ||
return parts.LastOrDefault() ?? string.Empty; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationUserEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Diagnostics.Tracing; | ||
using DevHome.Telemetry; | ||
using Microsoft.Diagnostics.Telemetry; | ||
using Microsoft.Diagnostics.Telemetry.Internal; | ||
|
||
namespace DevHome.Common.TelemetryEvents.SourceControlIntegration; | ||
|
||
[EventData] | ||
public class SourceControlIntegrationUserEvent : EventBase | ||
{ | ||
public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServicePerformance; | ||
|
||
public string RepositoryRootPath | ||
{ | ||
get; | ||
} | ||
|
||
public int TrackedRepositoryCount | ||
{ | ||
get; | ||
} | ||
|
||
public SourceControlIntegrationUserEvent(string sourceControlProviderClassId, string repositoryRootPath, int trackedRepositoryCount) | ||
{ | ||
RepositoryRootPath = SourceControlIntegrationHelper.GetSafeRootPath(repositoryRootPath); | ||
TrackedRepositoryCount = trackedRepositoryCount; | ||
} | ||
|
||
public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings) | ||
{ | ||
// The only sensitive strings is the repository root path. GetSafeRootPath is used to potentially remove PII and | ||
// keep last part of path. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters