Tom Pierce's Blog : Let the geek times roll.
Updated: 6/20/04; 3:21:15 PM.

 

Subscribe to "Tom Pierce's Blog" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Tuesday, January 6, 2004

Have you discovered the PerformanceProfiler yet?  This is a Toplink class that allows you to add profiling to your log, and it's simply awesome.  Here's a sample of the output:

Profile(ReportQuery,
    class=com.fritolay.bsg.pog.db.valueobjects.Customer,
    number of objects=17,
    total time=80,
    local time=80,
    query prepare=20,
    sql execute=50,
    sql generation=10,
    time/object=4,
    objects/second=212,
)
} End Profile

You enable the profiler with code via your Session.  You'll probably want to do it on your ServerSession so that you can catch everything, however I can envision a scenario where you might only want to profile one of your ClientSessions.  Whatever.  The call is setProfiler on session and it takes a SessionProfiler, the parent of PerformanceProfiler.

Have fun!

3:13:32 PM    comment []

Here's a tasty little Toplink morsel to kick of the new year.  If you are setting up session logging in Toplink, and you are doing it by hand, you should set the logging options on the ServerSession not the ClientSession.  If you set it on the ClientSession, you won't get the SQL statements dumped to your log!  How do you like that?  Tasty, I know.
2:17:39 PM    comment []

© Copyright 2004 Tom Pierce.



Click here to visit the Radio UserLand website.

 


January 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Dec   Feb

Search

[sgl dagger]
How this works

Emacs Sources
 tsql-indent.el
 user-add-sql-folding-marks
 remove-line-boundary-in-region
 convert-camel-to-underscore

My Subscriptions
 Funny
 KM