Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

SQL benchmarking with maven  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm using maven 2.2

With it I am able to run code-based tests and get both their success/failure result AND the time of execution in surefire reports. So I can perform a kind of benchmarking for my tests.

Now I'm using maven sql plugin http://mojo.codehaus.org/sql-maven-plugin/
With it I don't have to write any jdbc code and can perform sql queries right from *.sql files. I have a set of queries to create schema, populate tables with data and queries to perform some selects which I want to benchmark. Even though I put sql plugin goal "execute" into "test" phase I don't have any reports being generated, all sql-s are performed without any reports (like they are just used for preparation).

As you may understand there is no java code involved into this test, just plain sql queries. But I want to incorporate database testing into my project, controlled by maven.
So do you know any way to implement time measuring of my sql goals, so I can see that one select query took X seconds and the other Y seconds.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see anything in the properties at http://mojo.codehaus.org/sql-maven-plugin/execute-mojo.html that will give you that information. But it should not be that hard to create a new plugin that extents this plugin and provided the timing information that you want. Or you could modify the plugin directly and submit the changes back to the maven team. Hey, that is what open source is all about.
 
Pavel Kazlou
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Peter.
I think sql plugin is not suited for testing, so I ended up writing test part of my case in classes using jdbc and measuring the time of their execution.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!