SQL Time

Posts   
 
    
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 12-Oct-2009 10:30:03   

Hello

I'm using webservice and I'm trying to have a "benchmark" mode that give the time taken by each part of the process. So, I'm trying to measure the time taken by all sql calls that occurs during the webmethod call. It's quite simple because a webmethod call always create a new adapter.

I've added a Stopwatch object in a derived adapter class, so all I need is to call stopwatch.Start and stopwatch.Stop before and after the sql call.

So my question is: which methods, in the adapter class, should I override to be sure that all generated SQL is measured ?

Tx a lot.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 12-Oct-2009 11:20:49   

Isn't this better measured at the database side? i.e. using SQL Profiler.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 12-Oct-2009 11:45:47   

We just received word that Huagati systems has released their v1.2 profiler which also supports LLBLGen Pro now (adapter only at the moment). http://huagati.blogspot.com/2009/10/query-profiling-for-llblgen-pro-based.html

It's not a free toolkit, but it might help you. Download page still says linq to sql, but it's now linq to sql AND llblgen pro. Just a FYI, as you're looking into getting information about runtime statistics.

Frans Bouma | Lead developer LLBLGen Pro
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 12-Oct-2009 11:50:01   

If you want to know which query are slow and need to be improved yes it's better to use the sql profiler. But this is not my goal.

I want to have, for one webmethod call, the time taken by different parts when the request reach the server: unzip, unserialization, business time & sql time, serialization, and finally zip. (soap message can be bzipped). The network time will also be available because I'll add some code on the client side.

With the sql profiler log, you cannot link the sql query to the webmethod that made it...

Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 12-Oct-2009 13:35:07   

Otis wrote:

We just received word that Huagati systems has released their v1.2 profiler which also supports LLBLGen Pro now (adapter only at the moment). http://huagati.blogspot.com/2009/10/query-profiling-for-llblgen-pro-based.html

It's not a free toolkit, but it might help you. Download page still says linq to sql, but it's now linq to sql AND llblgen pro. Just a FYI, as you're looking into getting information about runtime statistics.

This tool is really nice, indeed. But it's not what I need now simple_smile

But this tool show that it's possible to override some method in the adapter to intercet all sql call, so do you know which method I need to override ? Is it only one method used for all query ? Like the ExecuteReader / ExecuteNonQuery in ADO

Tx for your help !

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 12-Oct-2009 17:38:14   

IMHO, you should treat LLBLGen Pro DAL +Database as a balck box, since you don't want to measure the query time in the database side.

And thus, you should record thetime before and after calling any of the DataAccessAdapter methods. (Wrapping the adapter calls).

Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 13-Oct-2009 09:49:32   

Well ... it's was exactly my question: which method I need to override/wrap.

I'm sure it's not needed to override all DataAccessAdapter methods, there are certainly a few points where all method pass throught ...

But as it seem you don't know which one exactly, I'll try to trace to find it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 13-Oct-2009 11:06:00   

Fab wrote:

Well ... it's was exactly my question: which method I need to override/wrap.

I'm sure it's not needed to override all DataAccessAdapter methods, there are certainly a few points where all method pass throught ...

But as it seem you don't know which one exactly, I'll try to trace to find it.

The methods used for fetching are the Execute.....Query methods. The methods used to execute an action query, e.g. saving, deleting, is ExecuteActionQuery.

The point is though: what do you want to measure? As walaa explained: it's better to start inside your own application and see how long a process takes than to measure what a low-level method does, as it might give you data not not really information simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Fab
User
Posts: 108
Joined: 20-Oct-2008
# Posted on: 13-Oct-2009 11:12:20   

I want both: - the complete process time (allready done) - and also the details (I'm doing it now), and one of these details is the sql time.

Tx for the info!