Skip to content

Conversation

machavan
Copy link
Contributor

@machavan machavan commented Jul 15, 2025

Description:

This is a foundational change for introducing performance loggers which can be used tracking performance of various activities within the mssql-jdbc driver e.g. connection time, login time, token acquisition time etc.

A new java.util.Logging logger com.microsoft.sqlserver.jdbc.PerformanceMetrics.Connection is introduced here which can be subscribed to by applications.
More loggers such as com.microsoft.sqlserver.jdbc.PerformanceMetrics.Statement will be introduced in future.

Various performance activities to be tracked are defined in a PerformanceActivity Enum which will be amended with new additions in future.

Testing:
-Manual testing of new logger functionality.
-All existing tests ensure testing of newly added code.

Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.60%. Comparing base (6e9226f) to head (2a5d3d7).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...a/com/microsoft/sqlserver/jdbc/PerformanceLog.java 64.86% 8 Missing and 5 partials ⚠️
.../microsoft/sqlserver/jdbc/PerformanceActivity.java 90.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2706      +/-   ##
============================================
+ Coverage     51.49%   51.60%   +0.10%     
- Complexity     4060     4077      +17     
============================================
  Files           149      151       +2     
  Lines         34136    34331     +195     
  Branches       5700     5727      +27     
============================================
+ Hits          17580    17718     +138     
- Misses        14090    14117      +27     
- Partials       2466     2496      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

.getProperty(SQLServerDriverStringProperty.USER.toString());

if (null != managedIdentityClientId && !managedIdentityClientId.isEmpty()) {
try (PerformanceLog.Scope fedAuthScope = PerformanceLog.createScope(PerformanceLog.perfLoggerConnection, traceID, PerformanceActivity.TOKEN_ACQUISITION)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually put this in onFedAuthInfo, so that the scope includes calls to any access token callbacks (but not the last two lines in there that send the token to the server).

@machavan machavan added this to the 13.3.0 milestone Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants