Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

adding some metrics to metrics-sql #3

wants to merge 7 commits into from

Conversation

shalom938
Copy link

No description provided.

@gquintana gquintana self-requested a review August 29, 2017 15:15
@@ -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.
Copy link
Owner

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
Copy link
Owner

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);
Copy link
Owner

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;
Copy link
Owner

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) {
Copy link
Owner

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);
Copy link
Owner

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 {
Copy link
Owner

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{
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants