Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dropwizard/metrics
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: release/4.2.x
Choose a base ref
...
head repository: intercom/metrics
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,6 @@ For more information, please see [the documentation](http://dropwizard.github.io
License
-------

Copyright (c) 2010-2013 Coda Hale, Yammer.com
Copyright (c) 2010-2014 Coda Hale, Yammer.com

Published under Apache Software License 2.0, see LICENSE
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@
# The short X.Y version.
version = '3.1'
# The full version, including alpha/beta/rc tags.
release = '3.1.0'
release = '4.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
7 changes: 7 additions & 0 deletions docs/source/manual/third-party.rst
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ the many third-party libraries which extend Metrics:
* `sematext-metrics-reporter <https://github.com/sematext/sematext-metrics-reporter>`_ provides a reporter for `SPM <http://sematext.com/spm/index.html>`_.
* `wicket-metrics <https://github.com/NitorCreations/wicket-metrics>`_ provides easy integration for your `Wicket <http://wicket.apache.org/>`_ application.
* `metrics-guice <https://github.com/palominolabs/metrics-guice>`_ provides integration with `Guice <https://code.google.com/p/google-guice/>`_.
* `metrics-guice-servlet <https://github.com/palominolabs/metrics-guice-servlet>`_ provides `Guice Servlet <https://github.com/google/guice/wiki/Servlets>`_ integration with AdminServlet.
* `metrics-scala <https://github.com/erikvanoosten/metrics-scala>`_ provides an API optimized for Scala.
* `metrics-clojure <https://github.com/sjl/metrics-clojure>`_ provides an API optimized for Clojure.
* `metrics-cassandra <https://github.com/brndnmtthws/metrics-cassandra>`_ provides a reporter for `Apache Cassandra <https://cassandra.apache.org/>`_.
@@ -24,3 +25,9 @@ the many third-party libraries which extend Metrics:
* `metrics-cdi <https://github.com/astefanutti/metrics-cdi>`_ provides integration with `CDI <http://www.cdi-spec.org/>`_ environments
* `metrics-aspectj <https://github.com/astefanutti/metrics-aspectj>`_ provides integration with `AspectJ <http://eclipse.org/aspectj/>`_
* `camel-metrics <https://github.com/InitiumIo/camel-metrics>`_ provides component for your `Apache Camel <https://camel.apache.org/>`_ route
* `metrics-splunk <https://github.com/zenmoto/metrics-splunk>`_ provides a reporter for `Splunk <http://www.splunk.com/>`_
* `metrics-spark-reporter <https://github.com/ippontech/metrics-spark-reporter>`_ provides a reporter for `Apache Spark Streaming <https://spark.apache.org/streaming/>`_.
* `jersey-metrics-filter <https://github.com/palominolabs/jersey-metrics-filter>`_ provides integration with Jersey 1.
* `metrics-new-relic <https://github.com/palominolabs/metrics-new-relic>`_ provides a reporter which sends data to New Relic.
* `hdrhistogram-metrics-reservoir <https://bitbucket.org/marshallpierce/hdrhistogram-metrics-reservoir>`_ provides a Histogram reservoir backed by `HdrHistogram <http://hdrhistogram.org/>`_.
* `metrics-instrumental <https://github.com/egineering-llc/metrics-instrumental>`_ provides a reporter to send data to `Instrumental <http://instrumentalapp.com/>`_.
4 changes: 4 additions & 0 deletions metrics-benchmarks/pom.xml
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@
A development module for performance benchmarks of Metrics classes.
</description>

<properties>
<jmh.version>1.1.1</jmh.version>
</properties>

<dependencies>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

public class DefaultObjectNameFactory implements ObjectNameFactory {

private static final Logger LOGGER = LoggerFactory.getLogger(JmxReporter.class);
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultObjectNameFactory.class);

@Override
public ObjectName createName(String type, String domain, String name) {
Original file line number Diff line number Diff line change
@@ -3,12 +3,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicLong;

/**
@@ -26,6 +21,7 @@ public class InstrumentedExecutorService implements ExecutorService {
private final Counter running;
private final Meter completed;
private final Timer duration;
private final Meter rejected;

/**
* Wraps an {@link ExecutorService} uses an auto-generated default name.
@@ -50,6 +46,7 @@ public InstrumentedExecutorService(ExecutorService delegate, MetricRegistry regi
this.running = registry.counter(MetricRegistry.name(name, "running"));
this.completed = registry.meter(MetricRegistry.name(name, "completed"));
this.duration = registry.timer(MetricRegistry.name(name, "duration"));
this.rejected = registry.meter(MetricRegistry.name(name, "rejected"));
}

/**
@@ -58,7 +55,12 @@ public InstrumentedExecutorService(ExecutorService delegate, MetricRegistry regi
@Override
public void execute(Runnable runnable) {
submitted.mark();
delegate.execute(new InstrumentedRunnable(runnable));
try {
delegate.execute(new InstrumentedRunnable(runnable));
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -67,7 +69,12 @@ public void execute(Runnable runnable) {
@Override
public Future<?> submit(Runnable runnable) {
submitted.mark();
return delegate.submit(new InstrumentedRunnable(runnable));
try {
return delegate.submit(new InstrumentedRunnable(runnable));
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -76,7 +83,12 @@ public Future<?> submit(Runnable runnable) {
@Override
public <T> Future<T> submit(Runnable runnable, T result) {
submitted.mark();
return delegate.submit(new InstrumentedRunnable(runnable), result);
try {
return delegate.submit(new InstrumentedRunnable(runnable), result);
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -85,7 +97,12 @@ public <T> Future<T> submit(Runnable runnable, T result) {
@Override
public <T> Future<T> submit(Callable<T> task) {
submitted.mark();
return delegate.submit(new InstrumentedCallable<T>(task));
try {
return delegate.submit(new InstrumentedCallable<T>(task));
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -95,7 +112,12 @@ public <T> Future<T> submit(Callable<T> task) {
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException {
submitted.mark(tasks.size());
Collection<? extends Callable<T>> instrumented = instrument(tasks);
return delegate.invokeAll(instrumented);
try {
return delegate.invokeAll(instrumented);
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -105,7 +127,12 @@ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) th
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
submitted.mark(tasks.size());
Collection<? extends Callable<T>> instrumented = instrument(tasks);
return delegate.invokeAll(instrumented, timeout, unit);
try {
return delegate.invokeAll(instrumented, timeout, unit);
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -115,7 +142,12 @@ public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, lo
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws ExecutionException, InterruptedException {
submitted.mark(tasks.size());
Collection<? extends Callable<T>> instrumented = instrument(tasks);
return delegate.invokeAny(instrumented);
try {
return delegate.invokeAny(instrumented);
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

/**
@@ -125,7 +157,12 @@ public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws Execution
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException {
submitted.mark(tasks.size());
Collection<? extends Callable<T>> instrumented = instrument(tasks);
return delegate.invokeAny(instrumented, timeout, unit);
try {
return delegate.invokeAny(instrumented, timeout, unit);
} catch (RejectedExecutionException e) {
rejected.mark();
throw e;
}
}

private <T> Collection<? extends Callable<T>> instrument(Collection<? extends Callable<T>> tasks) {
Loading