Skip to content

Commit

Permalink
Integrating review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescrosswell committed Jan 30, 2024
1 parent a7a8e1f commit e26175e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
15 changes: 9 additions & 6 deletions src/Sentry/BuiltInSystemDiagnosticsMeters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,8 @@ public static partial class BuiltInSystemDiagnosticsMeters
public static readonly SubstringOrRegexPattern SystemNetHttp = new Regex(SystemNetHttpPattern, RegexOptions.Compiled);
#endif

/// <summary>
/// Matches all built in metrics
/// </summary>
/// <returns></returns>
public static IList<SubstringOrRegexPattern> All = [
private static readonly Lazy<IList<SubstringOrRegexPattern>> LazyAll = new(() => new List<SubstringOrRegexPattern>
{
MicrosoftAspNetCoreHosting,
MicrosoftAspNetCoreRouting,
MicrosoftAspNetCoreDiagnostics,
Expand All @@ -166,5 +163,11 @@ public static partial class BuiltInSystemDiagnosticsMeters
SystemNetHttp,
MicrosoftExtensionsDiagnosticsHealthChecks,
MicrosoftExtensionsDiagnosticsResourceMonitoring
];
});

/// <summary>
/// Matches all built in metrics
/// </summary>
/// <returns></returns>
public static IList<SubstringOrRegexPattern> All => LazyAll.Value;
}
2 changes: 1 addition & 1 deletion src/Sentry/Internal/SystemDiagnosticsMetricsListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal void RecordMeasurement<T>(
T measurement,
ReadOnlySpan<KeyValuePair<string, object?>> tags,
object? _)
where T: struct
where T: struct, IConvertible
{
var unit = MeasurementUnit.Parse(instrument.Unit);
var tagDict = tags.ToImmutableArray().ToImmutableDictionary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Sentry
}
public static class BuiltInSystemDiagnosticsMeters
{
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreDiagnostics;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHeaderParsing;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHosting;
Expand All @@ -63,6 +62,7 @@ namespace Sentry
public static readonly Sentry.SubstringOrRegexPattern MicrosoftExtensionsDiagnosticsResourceMonitoring;
public static readonly Sentry.SubstringOrRegexPattern SystemNetHttp;
public static readonly Sentry.SubstringOrRegexPattern SystemNetNameResolution;
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All { get; }
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Sentry
}
public static class BuiltInSystemDiagnosticsMeters
{
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreDiagnostics;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHeaderParsing;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHosting;
Expand All @@ -63,6 +62,7 @@ namespace Sentry
public static readonly Sentry.SubstringOrRegexPattern MicrosoftExtensionsDiagnosticsResourceMonitoring;
public static readonly Sentry.SubstringOrRegexPattern SystemNetHttp;
public static readonly Sentry.SubstringOrRegexPattern SystemNetNameResolution;
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All { get; }
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Sentry
}
public static class BuiltInSystemDiagnosticsMeters
{
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreDiagnostics;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHeaderParsing;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHosting;
Expand All @@ -63,6 +62,7 @@ namespace Sentry
public static readonly Sentry.SubstringOrRegexPattern MicrosoftExtensionsDiagnosticsResourceMonitoring;
public static readonly Sentry.SubstringOrRegexPattern SystemNetHttp;
public static readonly Sentry.SubstringOrRegexPattern SystemNetNameResolution;
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All { get; }
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down
2 changes: 1 addition & 1 deletion test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ namespace Sentry
}
public static class BuiltInSystemDiagnosticsMeters
{
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreDiagnostics;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHeaderParsing;
public static readonly Sentry.SubstringOrRegexPattern MicrosoftAspNetCoreHosting;
Expand All @@ -63,6 +62,7 @@ namespace Sentry
public static readonly Sentry.SubstringOrRegexPattern MicrosoftExtensionsDiagnosticsResourceMonitoring;
public static readonly Sentry.SubstringOrRegexPattern SystemNetHttp;
public static readonly Sentry.SubstringOrRegexPattern SystemNetNameResolution;
public static System.Collections.Generic.IList<Sentry.SubstringOrRegexPattern> All { get; }
}
public class ByteAttachmentContent : Sentry.IAttachmentContent
{
Expand Down

0 comments on commit e26175e

Please sign in to comment.