Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I can't see the SQL stats.  RSS feed

 
Paco Martin Duque
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have installed Jamon API and I code the following lines:

For monitor a method:

Monitor mon=MonitorFactory.start("ActionManager.retrieveEmployees
("+databaseDriver+" "+urlConnection+")");
...
mon.stop()

For monitor a SQL:

con = DriverManager.getConnection( urlConnection , username, password);
// START SQL Monitoring
monitoredConnection = MonProxyFactory.monitor( con );
...
monitoredConnection.close();

But in the jamonadmin.jsp, I only see the following line about the servlet that calls to my component.

com.jamonapi.http.JAMonTomcatValve.request.contextpath: /p3_web-webapp, ms. 1 10.436

The question is: What are the steps to get the sql stats into the jamonadmin.jsp?

I think I have followed the steps indicate in the documentation , but nothing. May anyone help me?

Thanks in Advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Lucke Skywalker", please check your private messages.
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You probably have jamon in your classpath at both the server level and in web-inf/lib. Remove it from web-inf/lib.


con = DriverManager.getConnection( urlConnection , username, password);
// START SQL Monitoring
monitoredConnection = MonProxyFactory.monitor( con );
...
monitoredConnection.close();

Also, you can use the jamon jdbc proxy driver and instead of monitoring jdbc connections directly. This isn't causing your problem however, just not the preferred practice.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucke, Lucke, you're being naive. These are not the stats you're looking for.

(We give real answers to real people).
 
Paco Martin Duque
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Steven,

That's right! That was the problem. My component had the jamon.jar and the tomcat lib too.

It's wonderful. This information is fantastic .
The JAMON api is a key for the performance.

Now I can see the MonProxy label and more...

MonProxy-Interface (class=com.mysql.jdbc.JDBC4Connection): public abstract java.sql.Statement java.sql.Connection.createStatement() throws java.sql.SQLException, ms. 3 0 0 0 0 0 0 0 1 1 1/10/08 14:04:48 1/10/08 14:08:58 true false false
MonProxy-Interface (class=com.mysql.jdbc.JDBC4Connection): public abstract void java.sql.Connection.close() throws java.sql.SQLException, ms. 6 0 0 0 0 0 0 0 1 1 1/10/08 14:05:04 1/10/08 14:09:14 true false false
MonProxy-Interface (class=com.mysql.jdbc.StatementImpl): public abstract java.sql.ResultSet java.sql.Statement.executeQuery(java.lang.String) throws java.sql.SQLException, ms. 3 172 515 54 234 140 234 0 1 1 1/10/08 14:04:48 1/10/08 14:08:58 true false false
MonProxy-Interface (class=com.mysql.jdbc.StatementImpl): public abstract void java.sql.Statement.close() throws java.sql.SQLException, ms. 6 0 0 0 0 0 0 0 1 1 1/10/08 14:05:04 1/10/08 14:09:14 true false false
MonProxy-SQL-Statement: SELECT empno,ename,sal,deptno FROM emp, ms.


Thank you very much.

PD. I beg your pardon , Tim Holloway. I didn't know the name rule. But I have changed and I have written my real name. I'm so sorry.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem. Although we do have some people who deliberately flaunt it, I've always suspected that we don't post it prominently enough.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!