8000 Merge | Merge metrics/performance counter methodology by edwardneal · Pull Request #3251 · dotnet/SqlClient · GitHub
[go: up one dir, main page]

Skip to content

Merge | Merge metrics/performance counter methodology #3251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 21, 2025
Prev Previous commit
Next Next commit
Account for the removal of InternalsVisibleTo
  • Loading branch information
edwardneal committed Apr 11, 2025
commit 845903a288fc918b269a8f1e2612d55331c85a55
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,13 @@ internal static class SqlClientEventSourceProps

static SqlClientEventSourceProps()
{
s_log = SqlClientEventSource.Metrics;
Type sqlClientEventSourceType =
Assembly.GetAssembly(typeof(SqlConnection))!.GetType("Microsoft.Data.SqlClient.SqlClientEventSource");
Debug.Assert(sqlClientEventSourceType != null);
FieldInfo metricsField = sqlClientEventSourceType.GetField("Metrics", BindingFlags.Static | BindingFlags.Public);
Debug.Assert(metricsField != null);
Type sqlClientMetricsType = metricsField.FieldType;
s_log = metricsField.GetValue(null);

#if NETFRAMEWORK
Func<long> notApplicableFunction = static () => -1;
Expand Down
Loading
0