• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Profilling HQL?.. (Good Understanding)

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers..

is there any good way to count the estimate time which needed to run a HQL?..
in my application now..
i count the time needed to execute HQL with JUnit..
my code is like the following code :


is this a good idea?..
is there any another way?..
Thanks in advance..
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leonardo,

I think this kind of "profiling" test won't give you reliable results. If you run this test against a real database backend there will be many caching effects (database, JPA, file system, OS) and something like this which could lead to very varying results from test run to test run and of course database server to database server.

I'm not an expert in performance testing databases but I guess it would be more appropriate to do some kind of stress test or performance tests which runs this test multiple times and maybe concurrently with multiple connections. But then of course this definitely isn't a good unit test anymore. You should probably move it to a separate test suite for such tests. Unfortunately the absolute estimated time for these queries still depends on the performance of your test client machine and your database server and DBMS but it's still better than running this test only one with your other unit tests.

Perhaps I should mention that you probably shouldn't worry too much about this fine tuning except this part is really a performance bottleneck for your application

Marco
 
reply
    Bookmark Topic Watch Topic
  • New Topic