-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding some metrics to metrics-sql #3
base: master
Are you sure you want to change the base?
Conversation
@@ -3,6 +3,15 @@ | |||
This a Yammer|Codahale|Dropwizard Metrics extension to instrument JDBC resources | |||
and measure SQL execution times. | |||
|
|||
|
|||
## NOTE: this fork adds the following: | |||
1. add metrics on borrow connection, implemented in DataSourceProxyHandler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the PR description not in the readme.
|
||
/* | ||
* #%L | ||
* Metrics SQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the change here in license?
@@ -48,6 +48,8 @@ protected Object invoke(MethodInvocation<T> delegatingMethodInvocation) throws T | |||
result = close(delegatingMethodInvocation); | |||
} else if (methodName.equals("execute") || methodName.equals("executeQuery") || methodName.equals("executeUpdate")) { | |||
result = execute(delegatingMethodInvocation); | |||
} else if (methodName.equals("getResultSet")){ | |||
result = getResultSet(delegatingMethodInvocation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting change, I like it.
return connection; | ||
|
||
Timer.Context failedBorrowContext = null; | ||
Timer.Context borrowContext = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the difference between your borrow context timer and the original connection life timer.
/** | ||
* {@inheritDoc} | ||
*/ | ||
public Timer.Context startBorrowConnectionTimer(String databaseName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please integrate the new MetricsNamingStrategy API, it's cleaner.
@@ -170,6 +170,11 @@ public Properties getProperties() { | |||
public Class<? extends MetricRegistryHolder> getRegistryHolderClass() { | |||
return getProperty("metrics_registry_holder", Class.class, StaticMetricRegistryHolder.class); | |||
} | |||
|
|||
public Class<? extends JdbcProxyFactory> getJdbcProxyFactoryClass() { | |||
return getProperty("metrics_jdbc_proxy_factory", Class.class, JdbcProxyFactory.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need such an extension point? Why do you to replace the JdbcProxyFactory
/** | ||
* Created on 4/17/16. | ||
*/ | ||
public class DriverWrapper implements java.sql.Driver { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why another Driver?
|
||
|
||
|
||
private static class ConnectionProxyHandlerOnlyConnection extends ConnectionProxyHandler{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the difference with original connectionproxyhandler
No description provided.