使用CLR Profiler API跟踪数据库调用 [英] Using the CLR Profiler API to trace database calls

查看:107
本文介绍了使用CLR Profiler API跟踪数据库调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整理了一个基本的探查器,希望将其扩展到time db调用.  

I've put together a basic profiler which I would like to extend to time db calls.  

如果可能的话,我还要检索并记录存储过程名称或TSQL(如果由ORM生成).

If possible I would also like to retrieve and log the stored procedure name or TSQL if generated by an ORM.

我知道这是可能的,我已经看过其他分析器,但是我不知道从哪里开始.  

I know this is possible, I've seen other profilers do it but I don't know where to start.  

有人能指出我正确的方向吗?

Can anyone point me in the right direction?

在这里留下来

推荐答案

我知道我之前曾在这里看到过同样的问题,但似乎找不到它.简而言之,是的,这归结为使用IL重写来检测各种sql方法以捕获所需的信息并将其传递给探查器.

I know I have seen this same question asked here before, but can't seem to find it. In short, yes, it comes down to using IL rewriting to instrument various sql methods to capture the desired information and pass it down to the profiler.


这篇关于使用CLR Profiler API跟踪数据库调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆