-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fault telemetry for (hopefully) all VS APIs
- Loading branch information
Showing
21 changed files
with
840 additions
and
455 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
src/NuGet.Clients/NuGet.VisualStudio.Common/Telemetry/INuGetTelemetryProvider.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,18 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
using NuGet.Common; | ||
|
||
namespace NuGet.VisualStudio.Telemetry | ||
{ | ||
public interface INuGetTelemetryProvider | ||
{ | ||
Task EmitEventAsync(TelemetryEvent telemetryEvent); | ||
Task PostFaultAsync(Exception e, string callerClassName, [CallerMemberName] string callerMemberName = null, IDictionary<string, object> extraProperties = null); | ||
void PostFault(Exception e, string callerClassName, [CallerMemberName] string callerMemberName = null, IDictionary<string, object> extraProperties = null); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/NuGet.Clients/NuGet.VisualStudio.Common/Telemetry/NuGetTelemetryProvider.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,35 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.Composition; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading.Tasks; | ||
using NuGet.Common; | ||
|
||
namespace NuGet.VisualStudio.Telemetry | ||
{ | ||
[Export(typeof(INuGetTelemetryProvider))] | ||
internal class NuGetTelemetryProvider : INuGetTelemetryProvider | ||
{ | ||
public Task EmitEventAsync(TelemetryEvent telemetryEvent) | ||
{ | ||
TelemetryActivity.EmitTelemetryEvent(telemetryEvent); | ||
return Task.CompletedTask; | ||
} | ||
|
||
public async Task PostFaultAsync(Exception e, string callerClassName, [CallerMemberName] string callerMemberName = null, IDictionary<string, object> extraProperties = null) | ||
{ | ||
await TelemetryUtility.PostFaultAsync(e, callerClassName, callerMemberName, extraProperties); | ||
} | ||
|
||
public void PostFault(Exception e, string callerClassName, [CallerMemberName] string callerMemberName = null, IDictionary<string, object> extraProperties = null) | ||
{ | ||
NuGetUIThreadHelper.JoinableTaskFactory.Run(async () => | ||
{ | ||
await TelemetryUtility.PostFaultAsync(e, callerClassName, callerMemberName, extraProperties); | ||
}); | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.