https://github.com/devizer/universe.sqltrace
Tiny library, which wraps MS SQL Server sp_trace* calls into strongly types data access.
https://github.com/devizer/universe.sqltrace
Last synced: about 1 month ago
JSON representation
Tiny library, which wraps MS SQL Server sp_trace* calls into strongly types data access.
- Host: GitHub
- URL: https://github.com/devizer/universe.sqltrace
- Owner: devizer
- License: mit
- Created: 2017-04-20T09:54:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T04:45:22.000Z (about 1 year ago)
- Last Synced: 2025-02-20T05:30:06.667Z (about 1 year ago)
- Language: C#
- Size: 698 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Universe.SqlTrace
Tiny library, which wraps MS SQL Server Profiler API (`sp_trace*` calls and queries to `::fn_trace_gettable`) into strongly types data access.
It supports column chooser and row filtering.
Tested on SQL Server 2005 ... 2022 (incuding MS SQL LocalDB) is fully automated in linux and windows.
Targets both .NET Core, .Net Standard, and .NET Framework
Version 1.8+ Supports both System and Microsoft sql client.
### About API
#### Optional columns chooser
* `Sql`: SP name or SQL Batch Text
* `Application`: Application Name
* `Database`: Database Name
* `ClientHost`: Client Host Name
* `ClientProcess`: Client Process Id
* `Login`: Login
* `ServerProcess`: SQL Server Process Id
Version 1.7+ also provides actual and compiled execution plans.
#### Mandatory trace columns, which are always presented in the trace session
* `Duration`
* `CPU`
* `Reads`
* `Writes`
* `Rows`
#### Trace Session row filters
Any optional column above could be used as row filter: Application, Database, ClientHost, ClientProcess, Login or Server Process
#### Queries to session report:
* `ReadSummaryReport()`: returns sum of mandatory trace columns and number of sql-requests
* `ReadDetailsReport()`: returns all the info from trace session, namely TraceDetailsReport instance. Its possible to get summary or group by using TraceDetailsReport instance
* `ReadGroupsReport()`: returns sums of mandatory trace columns, grouped by one of optional trace column above.