Repository: cassandra Updated Branches: refs/heads/trunk 7082b64fc -> 6a473c4db
Fix Metered MBean registration patch by Aleksey Yeschenko; reviewed by Marcus Eriksson for CASSANDRA-14628 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6a473c4d Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6a473c4d Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6a473c4d Branch: refs/heads/trunk Commit: 6a473c4dbe31a64e6fcccdb6760347949d1d321a Parents: 7082b64 Author: Aleksey Yeshchenko <[email protected]> Authored: Thu Aug 23 11:49:10 2018 +0100 Committer: Aleksey Yeshchenko <[email protected]> Committed: Thu Aug 23 13:31:46 2018 +0100 ---------------------------------------------------------------------- .../metrics/CassandraMetricsRegistry.java | 24 ++++++++------------ 1 file changed, 10 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/6a473c4d/src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java b/src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java index 79d3c3e..43d6609 100644 --- a/src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java +++ b/src/java/org/apache/cassandra/metrics/CassandraMetricsRegistry.java @@ -182,29 +182,25 @@ public class CassandraMetricsRegistry extends MetricRegistry AbstractBean mbean; if (metric instanceof Gauge) - { mbean = new JmxGauge((Gauge<?>) metric, name); - } else if (metric instanceof Counter) - { + else if (metric instanceof Counter) mbean = new JmxCounter((Counter) metric, name); - } else if (metric instanceof Histogram) - { + else if (metric instanceof Histogram) mbean = new JmxHistogram((Histogram) metric, name); - } else if (metric instanceof Meter) - { - mbean = new JmxMeter((Meter) metric, name, TimeUnit.SECONDS); - } else if (metric instanceof Timer) - { + else if (metric instanceof Timer) mbean = new JmxTimer((Timer) metric, name, TimeUnit.SECONDS, TimeUnit.MICROSECONDS); - } else - { + else if (metric instanceof Metered) + mbean = new JmxMeter((Metered) metric, name, TimeUnit.SECONDS); + else throw new IllegalArgumentException("Unknown metric type: " + metric.getClass()); - } try { mBeanServer.registerMBean(mbean, name); - } catch (Exception ignored) {} + } + catch (Exception ignored) + { + } } private void registerAlias(MetricName existingName, MetricName aliasName) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
