dotnet-db-samples
dotnet-db-samples copied to clipboard
Performance counters based on Event Source in .NET Core
Are there plans about implementation performance counters based on Event Source? SqlClient Data Provider for SQL Server already have it: https://github.com/dotnet/SqlClient/pull/719
Not immediately. There haven't been too many people asking yet for this feature. If developers upvote the Event counters enhancement, then the ODP.NET team will make it a priority to add to a future release.
Previously, developers asked for the more traditional counters support via System.Diagnostics, which is available in ODP.NET Core on Windows today.
Should developers upvote current issue?
Yes, if it's something they want. I believe that's how organizations gauge the desirability of each feature request.
The number of upvotes and comments informs me and the Oracle .NET dev team which features developers want the most.
Is there an alternative to being able to monitor performance on a .net core application running managed data access? I'd like to start monitoring some oracle parameters under load and don't know if this is something that should even be possible.
@ronnyek You can use ODP.NET Core performance counters on Windows with System.Diagnostics.
@ronnyek You can use ODP.NET Core performance counters on Windows with System.Diagnostics.
Would this be based on this example? https://github.com/oracle/dotnet-db-samples/tree/master/samples/performance-counters
Do I really need an app.config with a .net core application? If not is there another way to tell the oracle drivers to enable the performance counters?
(I ran the powershell scripts to register the counters with windows, and can see them in performance monitor, just need to know how to tell my app to enable them)
For .NET Core, you wouldn't use app.config. You can set which counters to enable with the OracleConfiguration.PerformanceCounters
property. The table in the doc indicates the value of each counter type.
https://docs.oracle.com/en/database/oracle/oracle-database/21/odpnt/featConnecting.html#GUID-4FA1C8D3-195B-4D7A-9E9D-9FB74C7F5312
appreciate this response... hope it helps others too! Thanks again
I noticed I cant add these performance counters to performance monitor... they show up, but selecting them and hitting add doesn't actually add them.
Running lodctr /q
I get
[ODP.NET, Core Driver] Performance Counters (Enabled)
DLL Name: netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
First Counter ID: 0x00000C04 (3076)
Last Counter ID: 0x00000C1A (3098)
First Help ID: 0x00000C05 (3077)
Last Help ID: 0x00000C1B (3099)
And may be completely unrelated, but I notice other counters reference a dll with the same name, but include a relative path like so:
[ServiceModelEndpoint 3.0.0.0] Performance Counters (Enabled)
DLL Name: %systemroot%\system32\netfxperf.dll
Open Procedure: OpenPerformanceData
Collect Procedure: CollectPerformanceData
Close Procedure: ClosePerformanceData
First Counter ID: 0x00000B9E (2974)
Last Counter ID: 0x00000BC4 (3012)
First Help ID: 0x00000B9F (2975)
Last Help ID: 0x00000BC5 (3013)
Should I need to do anything special? I tried rebuilding registry etc, but still seems like perfmon is aware of the counters, just wont let me add them to an existing session
Run the ODP.NET Core app and leave it running. Go to PerfoMon and select the counters you're interested in. In the Instances window, you should see the app process. Select that process to monitor the counters.
You can see what the experience is supposed to be like by watching the second half of this video. https://www.youtube.com/watch?v=mNwaYIazxlw
Managed ODP.NET and ODP.NET Core plan to support .NET Metrics in lieu of event counters. Metrics has fewer limitations than event counters.
Managed ODP.NET and ODP.NET Core plan to support .NET Metrics in lieu of event counters. Metrics has fewer limitations than event counters.
@alexkeh What's the timeline for metrics support? Oracle Support indicated to us this would be included in 23c.
@mike-geiger The plan is to include .NET metrics support early in 2024. It will be part of ODP.NET 23c. The specific minor version to include it with hasn't been decided yet.
Managed ODP.NET and ODP.NET Core 23.3.2 is now available on NuGet Gallery with .NET Metrics support.