cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [4/4] cassandra git commit: Upgrade metrics library and remove depricated metrics
Date Wed, 28 Jan 2015 16:15:47 GMT
Upgrade metrics library and remove depricated metrics

Patch by tjake; reviewed by aleksey for CASSANDRA-5657


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8896a70b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8896a70b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8896a70b

Branch: refs/heads/trunk
Commit: 8896a70b015102c212d0a27ed1f4e1f0fabe85c4
Parents: bbb1592
Author: T Jake Luciani <jake@apache.org>
Authored: Mon Jan 5 09:34:08 2015 -0500
Committer: T Jake Luciani <jake@apache.org>
Committed: Wed Jan 28 11:12:19 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 build.xml                                       |   4 +-
 lib/licenses/metrics-core-2.2.0.txt             | 202 -----
 lib/licenses/metrics-core-3.1.0.txt             | 202 +++++
 lib/metrics-core-2.2.0.jar                      | Bin 82123 -> 0 bytes
 lib/metrics-core-3.1.0.jar                      | Bin 0 -> 111908 bytes
 .../cassandra/concurrent/IExecutorMBean.java    |  41 -
 .../JMXEnabledScheduledThreadPoolExecutor.java  |   4 +-
 .../JMXEnabledSharedExecutorPool.java           | 113 ---
 .../JMXEnabledThreadPoolExecutor.java           |  21 +-
 .../JMXEnabledThreadPoolExecutorMBean.java      |  19 +-
 .../cassandra/concurrent/SEPExecutor.java       |  32 +-
 .../concurrent/SharedExecutorPool.java          |   9 +
 .../org/apache/cassandra/concurrent/Stage.java  |  16 +
 .../cassandra/concurrent/StageManager.java      |   2 +-
 .../apache/cassandra/db/ColumnFamilyStore.java  | 176 +----
 .../cassandra/db/ColumnFamilyStoreMBean.java    | 234 ------
 .../cassandra/db/HintedHandOffManager.java      |   2 +-
 .../cassandra/db/commitlog/CommitLog.java       |  20 -
 .../cassandra/db/commitlog/CommitLogMBean.java  |  21 -
 .../cassandra/db/compaction/CompactionInfo.java |   3 +-
 .../db/compaction/CompactionManager.java        |   8 +-
 .../db/compaction/CompactionManagerMBean.java   |  28 -
 .../cassandra/db/filter/ExtendedFilter.java     |   2 +-
 src/java/org/apache/cassandra/gms/Gossiper.java |   2 +-
 .../locator/DynamicEndpointSnitch.java          |  18 +-
 .../metrics/CASClientRequestMetrics.java        |  20 +-
 .../apache/cassandra/metrics/CQLMetrics.java    |  30 +-
 .../apache/cassandra/metrics/CacheMetrics.java  |  59 +-
 .../metrics/CassandraMetricsRegistry.java       | 791 +++++++++++++++++++
 .../cassandra/metrics/ClearableHistogram.java   |  48 ++
 .../apache/cassandra/metrics/ClientMetrics.java |  13 +-
 .../cassandra/metrics/ClientRequestMetrics.java |  26 +-
 .../cassandra/metrics/ColumnFamilyMetrics.java  | 157 ++--
 .../cassandra/metrics/CommitLogMetrics.java     |  23 +-
 .../cassandra/metrics/CompactionMetrics.java    |  22 +-
 .../cassandra/metrics/ConnectionMetrics.java    |  66 +-
 .../cassandra/metrics/DefaultNameFactory.java   |   7 +-
 .../metrics/DroppedMessageMetrics.java          |  21 +-
 .../metrics/EstimatedHistogramReservoir.java    | 105 +++
 .../cassandra/metrics/FileCacheMetrics.java     |  32 +-
 .../cassandra/metrics/HintedHandoffMetrics.java |  15 +-
 .../cassandra/metrics/KeyspaceMetrics.java      |  62 +-
 .../cassandra/metrics/LatencyMetrics.java       |  44 +-
 .../cassandra/metrics/MetricNameFactory.java    |   3 +-
 .../cassandra/metrics/ReadRepairMetrics.java    |  14 +-
 .../cassandra/metrics/RestorableMeter.java      |  10 +-
 .../apache/cassandra/metrics/SEPMetrics.java    |  55 +-
 .../cassandra/metrics/StorageMetrics.java       |  13 +-
 .../cassandra/metrics/StreamingMetrics.java     |  16 +-
 .../metrics/ThreadPoolMetricNameFactory.java    |   6 +-
 .../cassandra/metrics/ThreadPoolMetrics.java    |  74 +-
 .../apache/cassandra/net/MessagingService.java  |  30 +-
 .../cassandra/net/MessagingServiceMBean.java    |  15 -
 .../net/OutboundTcpConnectionPool.java          |   6 +-
 .../scheduler/RoundRobinScheduler.java          |   2 -
 .../cassandra/scheduler/WeightedQueue.java      |  43 +-
 .../cassandra/scheduler/WeightedQueueMBean.java |  32 -
 .../apache/cassandra/service/CacheService.java  |  67 +-
 .../cassandra/service/CacheServiceMBean.java    |  86 --
 .../cassandra/service/CassandraDaemon.java      |   7 +-
 .../cassandra/service/LoadBroadcaster.java      |   3 +-
 .../apache/cassandra/service/StorageProxy.java  | 102 +--
 .../cassandra/service/StorageProxyMBean.java    |  48 --
 .../cassandra/service/StorageService.java       |  21 +-
 .../cassandra/service/StorageServiceMBean.java  |  10 -
 .../cassandra/thrift/CassandraServer.java       |   2 +-
 .../org/apache/cassandra/tools/NodeProbe.java   | 109 +--
 .../org/apache/cassandra/tools/NodeTool.java    |  56 +-
 .../transport/RequestThreadPoolExecutor.java    |   6 +-
 .../apache/cassandra/utils/StatusLogger.java    |  40 +-
 .../cassandra/utils/concurrent/WaitQueue.java   |  10 +-
 .../concurrent/LongSharedExecutorPoolTest.java  |   2 +-
 .../cassandra/db/LongFlushMemtableTest.java     |   2 +-
 .../apache/cassandra/utils/LongBTreeTest.java   |  15 +-
 .../cassandra/db/ColumnFamilyMetricTest.java    |  12 +-
 .../cassandra/db/ColumnFamilyStoreTest.java     |   5 +-
 .../org/apache/cassandra/db/KeyspaceTest.java   |  17 +-
 .../org/apache/cassandra/db/RowCacheTest.java   |  20 +-
 .../db/compaction/AntiCompactionTest.java       |   4 +-
 .../cassandra/io/sstable/SSTableReaderTest.java |   2 +-
 .../io/sstable/SSTableRewriterTest.java         |  16 +-
 .../cassandra/metrics/CQLMetricsTest.java       |  32 +-
 .../cassandra/metrics/LatencyMetricsTest.java   |   2 +-
 84 files changed, 1761 insertions(+), 1975 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 36b081b..16e7c7d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0
+ * Upgrade Metrics library and remove depricated metrics (CASSANDRA-5657)
  * Serializing Row cache alternative, fully off heap (CASSANDRA-7438)
  * Duplicate rows returned when in clause has repeated values (CASSANDRA-6707)
  * Make CassandraException unchecked, extend RuntimeException (CASSANDRA-8560)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index ce9a603..0d96f4c 100644
--- a/build.xml
+++ b/build.xml
@@ -368,7 +368,7 @@
 
           <dependency groupId="org.apache.cassandra" artifactId="cassandra-all" version="${version}" />
           <dependency groupId="org.apache.cassandra" artifactId="cassandra-thrift" version="${version}" />
-          <dependency groupId="com.yammer.metrics" artifactId="metrics-core" version="2.2.0" />
+          <dependency groupId="io.dropwizard.metrics" artifactId="metrics-core" version="3.1.0" />
           <dependency groupId="com.addthis.metrics" artifactId="reporter-config" version="2.1.0" />
           <dependency groupId="org.mindrot" artifactId="jbcrypt" version="0.3m" />
           <dependency groupId="io.airlift" artifactId="airline" version="0.6" />
@@ -483,7 +483,7 @@
         <dependency groupId="com.boundary" artifactId="high-scale-lib"/>
         <dependency groupId="org.yaml" artifactId="snakeyaml"/>
         <dependency groupId="org.mindrot" artifactId="jbcrypt"/>
-        <dependency groupId="com.yammer.metrics" artifactId="metrics-core"/>
+        <dependency groupId="io.dropwizard.metrics" artifactId="metrics-core"/>
         <dependency groupId="com.addthis.metrics" artifactId="reporter-config"/>
         <dependency groupId="com.thinkaurelius.thrift" artifactId="thrift-server" version="0.3.5"/>
         <dependency groupId="com.clearspring.analytics" artifactId="stream" version="2.5.2" />

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/lib/licenses/metrics-core-2.2.0.txt
----------------------------------------------------------------------
diff --git a/lib/licenses/metrics-core-2.2.0.txt b/lib/licenses/metrics-core-2.2.0.txt
deleted file mode 100644
index e4ba404..0000000
--- a/lib/licenses/metrics-core-2.2.0.txt
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright 2010-2012 Coda Hale and Yammer, Inc.
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/lib/licenses/metrics-core-3.1.0.txt
----------------------------------------------------------------------
diff --git a/lib/licenses/metrics-core-3.1.0.txt b/lib/licenses/metrics-core-3.1.0.txt
new file mode 100644
index 0000000..e4ba404
--- /dev/null
+++ b/lib/licenses/metrics-core-3.1.0.txt
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2010-2012 Coda Hale and Yammer, Inc.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/lib/metrics-core-2.2.0.jar
----------------------------------------------------------------------
diff --git a/lib/metrics-core-2.2.0.jar b/lib/metrics-core-2.2.0.jar
deleted file mode 100644
index 0f6d1cb..0000000
Binary files a/lib/metrics-core-2.2.0.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/lib/metrics-core-3.1.0.jar
----------------------------------------------------------------------
diff --git a/lib/metrics-core-3.1.0.jar b/lib/metrics-core-3.1.0.jar
new file mode 100644
index 0000000..564ffb7
Binary files /dev/null and b/lib/metrics-core-3.1.0.jar differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/IExecutorMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/IExecutorMBean.java b/src/java/org/apache/cassandra/concurrent/IExecutorMBean.java
deleted file mode 100644
index f085b9c..0000000
--- a/src/java/org/apache/cassandra/concurrent/IExecutorMBean.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.concurrent;
-
-/**
- * @see org.apache.cassandra.metrics.ThreadPoolMetrics
- */
-@Deprecated
-public interface IExecutorMBean
-{
-    /**
-     * Get the current number of running tasks
-     */
-    public int getActiveCount();
-
-    /**
-     * Get the number of completed tasks
-     */
-    public long getCompletedTasks();
-
-    /**
-     * Get the number of tasks waiting to be executed
-     */
-    public long getPendingTasks();
-
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/JMXEnabledScheduledThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledScheduledThreadPoolExecutor.java b/src/java/org/apache/cassandra/concurrent/JMXEnabledScheduledThreadPoolExecutor.java
index 64d9267..50c9591 100644
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledScheduledThreadPoolExecutor.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledScheduledThreadPoolExecutor.java
@@ -107,12 +107,12 @@ public class JMXEnabledScheduledThreadPoolExecutor extends DebuggableScheduledTh
 
     public int getTotalBlockedTasks()
     {
-        return (int) metrics.totalBlocked.count();
+        return (int) metrics.totalBlocked.getCount();
     }
 
     public int getCurrentlyBlockedTasks()
     {
-        return (int) metrics.currentBlocked.count();
+        return (int) metrics.currentBlocked.getCount();
     }
 
     public int getCoreThreads()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/JMXEnabledSharedExecutorPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledSharedExecutorPool.java b/src/java/org/apache/cassandra/concurrent/JMXEnabledSharedExecutorPool.java
deleted file mode 100644
index 54bb772..0000000
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledSharedExecutorPool.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-package org.apache.cassandra.concurrent;
-
-import java.lang.management.ManagementFactory;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.cassandra.metrics.SEPMetrics;
-
-public class JMXEnabledSharedExecutorPool extends SharedExecutorPool
-{
-
-    public static final JMXEnabledSharedExecutorPool SHARED = new JMXEnabledSharedExecutorPool("SharedPool");
-
-    public JMXEnabledSharedExecutorPool(String poolName)
-    {
-        super(poolName);
-    }
-
-    public interface JMXEnabledSEPExecutorMBean extends JMXEnabledThreadPoolExecutorMBean
-    {
-    }
-
-    public class JMXEnabledSEPExecutor extends SEPExecutor implements JMXEnabledSEPExecutorMBean
-    {
-
-        private final SEPMetrics metrics;
-        private final String mbeanName;
-
-        public JMXEnabledSEPExecutor(int poolSize, int maxQueuedLength, String name, String jmxPath)
-        {
-            super(JMXEnabledSharedExecutorPool.this, poolSize, maxQueuedLength);
-            metrics = new SEPMetrics(this, jmxPath, name);
-
-            MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
-            mbeanName = "org.apache.cassandra." + jmxPath + ":type=" + name;
-
-            try
-            {
-                mbs.registerMBean(this, new ObjectName(mbeanName));
-            }
-            catch (Exception e)
-            {
-                throw new RuntimeException(e);
-            }
-        }
-
-        private void unregisterMBean()
-        {
-            try
-            {
-                ManagementFactory.getPlatformMBeanServer().unregisterMBean(new ObjectName(mbeanName));
-            }
-            catch (Exception e)
-            {
-                throw new RuntimeException(e);
-            }
-
-            // release metrics
-            metrics.release();
-        }
-
-        @Override
-        public synchronized void shutdown()
-        {
-            // synchronized, because there is no way to access super.mainLock, which would be
-            // the preferred way to make this threadsafe
-            if (!isShutdown())
-            {
-                unregisterMBean();
-            }
-            super.shutdown();
-        }
-
-        public int getCoreThreads()
-        {
-            return 0;
-        }
-
-        public void setCoreThreads(int number)
-        {
-            throw new UnsupportedOperationException();
-        }
-
-        public void setMaximumThreads(int number)
-        {
-            throw new UnsupportedOperationException();
-        }
-    }
-
-    public TracingAwareExecutorService newExecutor(int maxConcurrency, int maxQueuedTasks, String name, String jmxPath)
-    {
-        JMXEnabledSEPExecutor executor = new JMXEnabledSEPExecutor(maxConcurrency, maxQueuedTasks, name, jmxPath);
-        executors.add(executor);
-        return executor;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
index 3f60df1..2b86701 100644
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutor.java
@@ -36,7 +36,7 @@ import org.apache.cassandra.metrics.ThreadPoolMetrics;
 public class JMXEnabledThreadPoolExecutor extends DebuggableThreadPoolExecutor implements JMXEnabledThreadPoolExecutorMBean
 {
     private final String mbeanName;
-    private final ThreadPoolMetrics metrics;
+    public final ThreadPoolMetrics metrics;
 
     public JMXEnabledThreadPoolExecutor(String threadPoolName)
     {
@@ -132,30 +132,17 @@ public class JMXEnabledThreadPoolExecutor extends DebuggableThreadPoolExecutor i
         return super.shutdownNow();
     }
 
-    /**
-     * Get the number of completed tasks
-     */
-    public long getCompletedTasks()
-    {
-        return getCompletedTaskCount();
-    }
 
-    /**
-     * Get the number of tasks waiting to be executed
-     */
-    public long getPendingTasks()
-    {
-        return getTaskCount() - getCompletedTaskCount();
-    }
+
 
     public int getTotalBlockedTasks()
     {
-        return (int) metrics.totalBlocked.count();
+        return (int) metrics.totalBlocked.getCount();
     }
 
     public int getCurrentlyBlockedTasks()
     {
-        return (int) metrics.currentBlocked.count();
+        return (int) metrics.currentBlocked.getCount();
     }
 
     public int getCoreThreads()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
index ed2a2ac..fb964ae 100644
--- a/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
+++ b/src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java
@@ -17,24 +17,9 @@
  */
 package org.apache.cassandra.concurrent;
 
-/**
- * @see org.apache.cassandra.metrics.ThreadPoolMetrics
- */
-@Deprecated
-public interface JMXEnabledThreadPoolExecutorMBean extends IExecutorMBean
-{
-    /**
-     * Get the number of tasks that had blocked before being accepted (or
-     * rejected).
-     */
-    public int getTotalBlockedTasks();
-
-    /**
-     * Get the number of tasks currently blocked, waiting to be accepted by
-     * the executor (because all threads are busy and the backing queue is full).
-     */
-    public int getCurrentlyBlockedTasks();
 
+public interface JMXEnabledThreadPoolExecutorMBean
+{
     /**
      * Returns core pool size of thread pool.
      */

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/SEPExecutor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/SEPExecutor.java b/src/java/org/apache/cassandra/concurrent/SEPExecutor.java
index f6d1940..d9a0fa8 100644
--- a/src/java/org/apache/cassandra/concurrent/SEPExecutor.java
+++ b/src/java/org/apache/cassandra/concurrent/SEPExecutor.java
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
+import org.apache.cassandra.metrics.SEPMetrics;
 import org.apache.cassandra.utils.concurrent.SimpleCondition;
 import org.apache.cassandra.utils.concurrent.WaitQueue;
 
@@ -35,6 +36,7 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
 
     public final int maxWorkers;
     private final int maxTasksQueued;
+    private final SEPMetrics metrics;
 
     // stores both a set of work permits and task permits:
     //  bottom 32 bits are number of queued tasks, in the range [0..maxTasksQueued]   (initially 0)
@@ -43,8 +45,6 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
 
     // producers wait on this when there is no room on the queue
     private final WaitQueue hasRoom = new WaitQueue();
-    private final AtomicLong totalBlocked = new AtomicLong();
-    private final AtomicInteger currentlyBlocked = new AtomicInteger();
     private final AtomicLong completedTasks = new AtomicLong();
 
     volatile boolean shuttingDown = false;
@@ -53,12 +53,13 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
     // TODO: see if other queue implementations might improve throughput
     protected final ConcurrentLinkedQueue<FutureTask<?>> tasks = new ConcurrentLinkedQueue<>();
 
-    SEPExecutor(SharedExecutorPool pool, int maxWorkers, int maxTasksQueued)
+    SEPExecutor(SharedExecutorPool pool, int maxWorkers, int maxTasksQueued, String jmxPath, String name)
     {
         this.pool = pool;
         this.maxWorkers = maxWorkers;
         this.maxTasksQueued = maxTasksQueued;
         this.permits.set(combine(0, maxWorkers));
+        this.metrics = new SEPMetrics(this, jmxPath, name);
     }
 
     protected void onCompletion()
@@ -116,10 +117,11 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
                 // if we're blocking, we might as well directly schedule a worker if we aren't already at max
                 if (takeWorkPermit(true))
                     pool.schedule(new Work(this));
-                totalBlocked.incrementAndGet();
-                currentlyBlocked.incrementAndGet();
+
+                metrics.totalBlocked.inc();
+                metrics.currentBlocked.inc();
                 s.awaitUninterruptibly();
-                currentlyBlocked.decrementAndGet();
+                metrics.currentBlocked.dec();
             }
             else // don't propagate our signal when we cancel, just cancel
                 s.cancel();
@@ -207,6 +209,9 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
         pool.executors.remove(this);
         if (getActiveCount() == 0)
             shutdown.signalAll();
+
+        // release metrics
+        metrics.release();
     }
 
     public synchronized List<Runnable> shutdownNow()
@@ -249,21 +254,6 @@ public class SEPExecutor extends AbstractTracingAwareExecutorService
         return maxWorkers - workPermits(permits.get());
     }
 
-    public int getTotalBlockedTasks()
-    {
-        return (int) totalBlocked.get();
-    }
-
-    public int getMaximumThreads()
-    {
-        return maxWorkers;
-    }
-
-    public int getCurrentlyBlockedTasks()
-    {
-        return currentlyBlocked.get();
-    }
-
     private static int taskPermits(long both)
     {
         return (int) both;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/SharedExecutorPool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/SharedExecutorPool.java b/src/java/org/apache/cassandra/concurrent/SharedExecutorPool.java
index fb3ff13..8c18c44 100644
--- a/src/java/org/apache/cassandra/concurrent/SharedExecutorPool.java
+++ b/src/java/org/apache/cassandra/concurrent/SharedExecutorPool.java
@@ -54,6 +54,8 @@ import static org.apache.cassandra.concurrent.SEPWorker.Work;
 public class SharedExecutorPool
 {
 
+    public static final SharedExecutorPool SHARED = new SharedExecutorPool("SharedPool");
+
     // the name assigned to workers in the pool, and the id suffix
     final String poolName;
     final AtomicLong workerId = new AtomicLong();
@@ -100,4 +102,11 @@ public class SharedExecutorPool
         if (current == 0 && spinningCount.compareAndSet(0, 1))
             schedule(Work.SPINNING);
     }
+
+    public TracingAwareExecutorService newExecutor(int maxConcurrency, int maxQueuedTasks, String jmxPath, String name)
+    {
+        SEPExecutor executor = new SEPExecutor(this, maxConcurrency, maxQueuedTasks, jmxPath, name);
+        executors.add(executor);
+        return executor;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/Stage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/Stage.java b/src/java/org/apache/cassandra/concurrent/Stage.java
index 6192cab..4e3700f 100644
--- a/src/java/org/apache/cassandra/concurrent/Stage.java
+++ b/src/java/org/apache/cassandra/concurrent/Stage.java
@@ -17,6 +17,11 @@
  */
 package org.apache.cassandra.concurrent;
 
+import java.util.Arrays;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
 public enum Stage
 {
     READ,
@@ -31,6 +36,17 @@ public enum Stage
     INTERNAL_RESPONSE,
     READ_REPAIR;
 
+    public static Iterable<Stage> jmxEnabledStages()
+    {
+        return Iterables.filter(Arrays.asList(values()), new Predicate<Stage>()
+        {
+            public boolean apply(Stage stage)
+            {
+                return stage != TRACING;
+            }
+        });
+    }
+
     public String getJmxType()
     {
         switch (this)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/concurrent/StageManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/concurrent/StageManager.java b/src/java/org/apache/cassandra/concurrent/StageManager.java
index 303f658..4f03fd5 100644
--- a/src/java/org/apache/cassandra/concurrent/StageManager.java
+++ b/src/java/org/apache/cassandra/concurrent/StageManager.java
@@ -89,7 +89,7 @@ public class StageManager
 
     private static TracingAwareExecutorService multiThreadedLowSignalStage(Stage stage, int numThreads)
     {
-        return JMXEnabledSharedExecutorPool.SHARED.newExecutor(numThreads, Integer.MAX_VALUE, stage.getJmxName(), stage.getJmxType());
+        return SharedExecutorPool.SHARED.newExecutor(numThreads, Integer.MAX_VALUE, stage.getJmxType(), stage.getJmxName());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 9824e4a..15aef94 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -365,7 +365,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
                 {
                     case PERCENTILE:
                         // get percentile in nanos
-                        assert metric.coordinatorReadLatency.durationUnit() == TimeUnit.MICROSECONDS;
                         sampleLatencyNanos = (long) (metric.coordinatorReadLatency.getSnapshot().getValue(retryPolicy.value) * 1000d);
                         break;
                     case CUSTOM:
@@ -425,25 +424,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         metric.release();
     }
 
-    public long getMinRowSize()
-    {
-        return metric.minRowSize.value();
-    }
-
-    public long getMaxRowSize()
-    {
-        return metric.maxRowSize.value();
-    }
-
-    public long getMeanRowSize()
-    {
-        return metric.meanRowSize.value();
-    }
-
-    public int getMeanColumns()
-    {
-        return data.getMeanColumns();
-    }
 
     public static ColumnFamilyStore createColumnFamilyStore(Keyspace keyspace, String columnFamily, boolean loadSSTables)
     {
@@ -1426,20 +1406,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return valid;
     }
 
-    public long getMemtableColumnsCount()
-    {
-        return metric.memtableColumnsCount.value();
-    }
 
-    public long getMemtableDataSize()
-    {
-        return metric.memtableOnHeapSize.value();
-    }
 
-    public int getMemtableSwitchCount()
-    {
-        return (int) metric.memtableSwitchCount.count();
-    }
 
     /**
      * Package protected for access from the CompactionManager.
@@ -1459,71 +1427,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return data.getUncompactingSSTables();
     }
 
-    public long[] getRecentSSTablesPerReadHistogram()
-    {
-        return metric.recentSSTablesPerRead.getBuckets(true);
-    }
-
-    public long[] getSSTablesPerReadHistogram()
-    {
-        return metric.sstablesPerRead.getBuckets(false);
-    }
-
-    public long getReadCount()
-    {
-        return metric.readLatency.latency.count();
-    }
-
-    public double getRecentReadLatencyMicros()
-    {
-        return metric.readLatency.getRecentLatency();
-    }
-
-    public long[] getLifetimeReadLatencyHistogramMicros()
-    {
-        return metric.readLatency.totalLatencyHistogram.getBuckets(false);
-    }
-
-    public long[] getRecentReadLatencyHistogramMicros()
-    {
-        return metric.readLatency.recentLatencyHistogram.getBuckets(true);
-    }
-
-    public long getTotalReadLatencyMicros()
-    {
-        return metric.readLatency.totalLatency.count();
-    }
-
-    public int getPendingTasks()
-    {
-        return (int) metric.pendingFlushes.count();
-    }
-
-    public long getWriteCount()
-    {
-        return metric.writeLatency.latency.count();
-    }
-
-    public long getTotalWriteLatencyMicros()
-    {
-        return metric.writeLatency.totalLatency.count();
-    }
-
-    public double getRecentWriteLatencyMicros()
-    {
-        return metric.writeLatency.getRecentLatency();
-    }
-
-    public long[] getLifetimeWriteLatencyHistogramMicros()
-    {
-        return metric.writeLatency.totalLatencyHistogram.getBuckets(false);
-    }
-
-    public long[] getRecentWriteLatencyHistogramMicros()
-    {
-        return metric.writeLatency.recentLatencyHistogram.getBuckets(true);
-    }
-
     public ColumnFamily getColumnFamily(DecoratedKey key,
                                         Composite start,
                                         Composite finish,
@@ -2328,19 +2231,9 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return directories.getSnapshotDetails();
     }
 
-    public long getTotalDiskSpaceUsed()
+    public boolean hasUnreclaimedSpace()
     {
-        return metric.totalDiskSpaceUsed.count();
-    }
-
-    public long getLiveDiskSpaceUsed()
-    {
-        return metric.liveDiskSpaceUsed.count();
-    }
-
-    public int getLiveSSTableCount()
-    {
-        return metric.liveSSTableCount.value();
+        return metric.liveDiskSpaceUsed.getCount() < metric.totalDiskSpaceUsed.getCount();
     }
 
     /**
@@ -2613,45 +2506,6 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return runWithCompactionsDisabled(callable, false);
     }
 
-    public long getBloomFilterFalsePositives()
-    {
-        return metric.bloomFilterFalsePositives.value();
-    }
-
-    public long getRecentBloomFilterFalsePositives()
-    {
-        return metric.recentBloomFilterFalsePositives.value();
-    }
-
-    public double getBloomFilterFalseRatio()
-    {
-        return metric.bloomFilterFalseRatio.value();
-    }
-
-    public double getRecentBloomFilterFalseRatio()
-    {
-        return metric.recentBloomFilterFalseRatio.value();
-    }
-
-    public long getBloomFilterDiskSpaceUsed()
-    {
-        return metric.bloomFilterDiskSpaceUsed.value();
-    }
-
-    public long getBloomFilterOffHeapMemoryUsed()
-    {
-        return metric.bloomFilterOffHeapMemoryUsed.value();
-    }
-
-    public long getIndexSummaryOffHeapMemoryUsed()
-    {
-        return metric.indexSummaryOffHeapMemoryUsed.value();
-    }
-
-    public long getCompressionMetadataOffHeapMemoryUsed()
-    {
-        return metric.compressionMetadataOffHeapMemoryUsed.value();
-    }
 
     @Override
     public String toString()
@@ -2748,38 +2602,18 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
                     "is deprecated, set the compaction strategy option 'enabled' to 'false' instead or use the nodetool command 'disableautocompaction'.");
     }
 
-    public double getTombstonesPerSlice()
-    {
-        return metric.tombstoneScannedHistogram.cf.getSnapshot().getMedian();
-    }
+    // End JMX get/set.
 
-    public double getLiveCellsPerSlice()
+    public int getMeanColumns()
     {
-        return metric.liveScannedHistogram.cf.getSnapshot().getMedian();
+        return data.getMeanColumns();
     }
 
-    // End JMX get/set.
-
     public long estimateKeys()
     {
         return data.estimatedKeys();
     }
 
-    public long[] getEstimatedRowSizeHistogram()
-    {
-        return metric.estimatedRowSizeHistogram.value();
-    }
-
-    public long[] getEstimatedColumnCountHistogram()
-    {
-        return metric.estimatedColumnCountHistogram.value();
-    }
-
-    public double getCompressionRatio()
-    {
-        return metric.compressionRatio.value();
-    }
-
     /** true if this CFS contains secondary index data */
     public boolean isIndex()
     {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
index d082125..1aad5c3 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStoreMBean.java
@@ -35,222 +35,11 @@ public interface ColumnFamilyStoreMBean
     public String getColumnFamilyName();
 
     /**
-     * Returns the total amount of data stored in the memtable, including
-     * column related overhead.
-     *
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#memtableOnHeapSize
-     * @return The size in bytes.
-     * @deprecated
-     */
-    @Deprecated
-    public long getMemtableDataSize();
-
-    /**
-     * Returns the total number of columns present in the memtable.
-     *
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#memtableColumnsCount
-     * @return The number of columns.
-     */
-    @Deprecated
-    public long getMemtableColumnsCount();
-
-    /**
-     * Returns the number of times that a flush has resulted in the
-     * memtable being switched out.
-     *
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#memtableSwitchCount
-     * @return the number of memtable switches
-     */
-    @Deprecated
-    public int getMemtableSwitchCount();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#recentSSTablesPerRead
-     * @return a histogram of the number of sstable data files accessed per read: reading this property resets it
-     */
-    @Deprecated
-    public long[] getRecentSSTablesPerReadHistogram();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#sstablesPerReadHistogram
-     * @return a histogram of the number of sstable data files accessed per read
-     */
-    @Deprecated
-    public long[] getSSTablesPerReadHistogram();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#readLatency
-     * @return the number of read operations on this column family
-     */
-    @Deprecated
-    public long getReadCount();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#readLatency
-     * @return total read latency (divide by getReadCount() for average)
-     */
-    @Deprecated
-    public long getTotalReadLatencyMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#readLatency
-     * @return an array representing the latency histogram
-     */
-    @Deprecated
-    public long[] getLifetimeReadLatencyHistogramMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#readLatency
-     * @return an array representing the latency histogram
-     */
-    @Deprecated
-    public long[] getRecentReadLatencyHistogramMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#readLatency
-     * @return average latency per read operation since the last call
-     */
-    @Deprecated
-    public double getRecentReadLatencyMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#writeLatency
-     * @return the number of write operations on this column family
-     */
-    @Deprecated
-    public long getWriteCount();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#writeLatency
-     * @return total write latency (divide by getReadCount() for average)
-     */
-    @Deprecated
-    public long getTotalWriteLatencyMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#writeLatency
-     * @return an array representing the latency histogram
-     */
-    @Deprecated
-    public long[] getLifetimeWriteLatencyHistogramMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#writeLatency
-     * @return an array representing the latency histogram
-     */
-    @Deprecated
-    public long[] getRecentWriteLatencyHistogramMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#writeLatency
-     * @return average latency per write operation since the last call
-     */
-    @Deprecated
-    public double getRecentWriteLatencyMicros();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#pendingFlushes
-     * @return the estimated number of tasks pending for this column family
-     */
-    @Deprecated
-    public int getPendingTasks();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#liveSSTableCount
-     * @return the number of SSTables on disk for this CF
-     */
-    @Deprecated
-    public int getLiveSSTableCount();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#liveDiskSpaceUsed
-     * @return disk space used by SSTables belonging to this CF
-     */
-    @Deprecated
-    public long getLiveDiskSpaceUsed();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#totalDiskSpaceUsed
-     * @return total disk space used by SSTables belonging to this CF, including obsolete ones waiting to be GC'd
-     */
-    @Deprecated
-    public long getTotalDiskSpaceUsed();
-
-    /**
      * force a major compaction of this column family
      */
     public void forceMajorCompaction() throws ExecutionException, InterruptedException;
 
     /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#minRowSize
-     * @return the size of the smallest compacted row
-     */
-    @Deprecated
-    public long getMinRowSize();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#maxRowSize
-     * @return the size of the largest compacted row
-     */
-    @Deprecated
-    public long getMaxRowSize();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#meanRowSize
-     * @return the average row size across all the sstables
-     */
-    @Deprecated
-    public long getMeanRowSize();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#bloomFilterFalsePositives
-     */
-    @Deprecated
-    public long getBloomFilterFalsePositives();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#recentBloomFilterFalsePositives
-     */
-    @Deprecated
-    public long getRecentBloomFilterFalsePositives();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#bloomFilterFalseRatio
-     */
-    @Deprecated
-    public double getBloomFilterFalseRatio();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#recentBloomFilterFalseRatio
-     */
-    @Deprecated
-    public double getRecentBloomFilterFalseRatio();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#bloomFilterDiskSpaceUsed
-     */
-    @Deprecated
-    public long getBloomFilterDiskSpaceUsed();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#bloomFilterOffHeapMemoryUsed
-     */
-    @Deprecated
-    public long getBloomFilterOffHeapMemoryUsed();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#indexSummaryOffHeapMemoryUsed
-     */
-    @Deprecated
-    public long getIndexSummaryOffHeapMemoryUsed();
-
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#compressionMetadataOffHeapMemoryUsed
-     */
-    @Deprecated
-    public long getCompressionMetadataOffHeapMemoryUsed();
-
-    /**
      * Gets the minimum number of sstables in queue before compaction kicks off
      */
     public int getMinimumCompactionThreshold();
@@ -304,31 +93,8 @@ public interface ColumnFamilyStoreMBean
 
     public boolean isAutoCompactionDisabled();
 
-    /** Number of tombstoned cells retreived during the last slicequery */
-    @Deprecated
-    public double getTombstonesPerSlice();
-
-    /** Number of live cells retreived during the last slicequery */
-    @Deprecated
-    public double getLiveCellsPerSlice();
-
     public long estimateKeys();
 
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#estimatedRowSizeHistogram
-     */
-    @Deprecated
-    public long[] getEstimatedRowSizeHistogram();
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#estimatedColumnCountHistogram
-     */
-    @Deprecated
-    public long[] getEstimatedColumnCountHistogram();
-    /**
-     * @see org.apache.cassandra.metrics.ColumnFamilyMetrics#compressionRatio
-     */
-    @Deprecated
-    public double getCompressionRatio();
 
     /**
      * Returns a list of the names of the built column indexes for current store

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 2bc26ae..324943a 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -482,7 +482,7 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
         if (meanColumnCount <= 0)
             return PAGE_SIZE;
 
-        int averageColumnSize = (int) (hintStore.getMeanRowSize() / meanColumnCount);
+        int averageColumnSize = (int) (hintStore.metric.meanRowSize.getValue() / meanColumnCount);
         if (averageColumnSize <= 0)
             return PAGE_SIZE;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
index 416b51d..55b0022 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLog.java
@@ -291,26 +291,6 @@ public class CommitLog implements CommitLogMBean
         }
     }
 
-    @Override
-    public long getCompletedTasks()
-    {
-        return metrics.completedTasks.value();
-    }
-
-    @Override
-    public long getPendingTasks()
-    {
-        return metrics.pendingTasks.value();
-    }
-
-    /**
-     * @return the total size occupied by commitlog segments expressed in bytes. (used by MBean)
-     */
-    public long getTotalCommitlogSize()
-    {
-        return metrics.totalCommitLogSize.value();
-    }
-
     public List<String> getActiveSegmentNames()
     {
         List<String> segmentNames = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
index 6c0d8d7..150ec20 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java
@@ -24,27 +24,6 @@ import java.util.List;
 public interface CommitLogMBean
 {
     /**
-     * Get the number of completed tasks
-     * @see org.apache.cassandra.metrics.CommitLogMetrics#completedTasks
-     */
-    @Deprecated
-    public long getCompletedTasks();
-
-    /**
-     * Get the number of tasks waiting to be executed
-     * @see org.apache.cassandra.metrics.CommitLogMetrics#pendingTasks
-     */
-    @Deprecated
-    public long getPendingTasks();
-
-    /**
-     * Get the current size used by all the commitlog segments.
-     * @see org.apache.cassandra.metrics.CommitLogMetrics#totalCommitLogSize
-     */
-    @Deprecated
-    public long getTotalCommitlogSize();
-
-    /**
      * Recover a single file.
      */
     public void recover(String path) throws IOException;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java b/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
index d086eef..3ee3a68 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionInfo.java
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.cassandra.config.CFMetaData;
+import org.apache.cassandra.metrics.StorageMetrics;
 import org.apache.cassandra.service.StorageService;
 
 /** Implements serializable to allow structured info to be returned via JMX. */
@@ -121,7 +122,7 @@ public final class CompactionInfo implements Serializable
     {
         private volatile boolean stopRequested = false;
         public abstract CompactionInfo getCompactionInfo();
-        double load = StorageService.instance.getLoad();
+        double load = StorageMetrics.load.getCount();
         double reportedSeverity = 0d;
 
         public void stop()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 99945b6..a1672a2 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1369,22 +1369,22 @@ public class CompactionManager implements CompactionManagerMBean
 
     public long getTotalBytesCompacted()
     {
-        return metrics.bytesCompacted.count();
+        return metrics.bytesCompacted.getCount();
     }
 
     public long getTotalCompactionsCompleted()
     {
-        return metrics.totalCompactionsCompleted.count();
+        return metrics.totalCompactionsCompleted.getCount();
     }
 
     public int getPendingTasks()
     {
-        return metrics.pendingTasks.value();
+        return metrics.pendingTasks.getValue();
     }
 
     public long getCompletedTasks()
     {
-        return metrics.completedTasks.value();
+        return metrics.completedTasks.getValue();
     }
 
     private static class CleanupInfo extends CompactionInfo.Holder

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java b/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
index 6900b9f..9c36192 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManagerMBean.java
@@ -33,34 +33,6 @@ public interface CompactionManagerMBean
     public TabularData getCompactionHistory();
 
     /**
-     * @see org.apache.cassandra.metrics.CompactionMetrics#pendingTasks
-     * @return estimated number of compactions remaining to perform
-     */
-    @Deprecated
-    public int getPendingTasks();
-
-    /**
-     * @see org.apache.cassandra.metrics.CompactionMetrics#completedTasks
-     * @return number of completed compactions since server [re]start
-     */
-    @Deprecated
-    public long getCompletedTasks();
-
-    /**
-     * @see org.apache.cassandra.metrics.CompactionMetrics#bytesCompacted
-     * @return total number of bytes compacted since server [re]start
-     */
-    @Deprecated
-    public long getTotalBytesCompacted();
-
-    /**
-     * @see org.apache.cassandra.metrics.CompactionMetrics#totalCompactionsCompleted
-     * @return total number of compactions since server [re]start
-     */
-    @Deprecated
-    public long getTotalCompactionsCompleted();
-
-    /**
      * Triggers the compaction of user specified sstables.
      * You can specify files from various keyspaces and columnfamilies.
      * If you do so, user defined compaction is performed several times to the groups of files

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
index fc2ff93..f908e8c 100644
--- a/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/ExtendedFilter.java
@@ -214,7 +214,7 @@ public abstract class ExtendedFilter
             {
                 // if we have a high chance of getting all the columns in a single index slice (and it's not too costly), do that.
                 // otherwise, the extraFilter (lazily created) will fetch by name the columns referenced by the additional expressions.
-                if (cfs.getMaxRowSize() < DatabaseDescriptor.getColumnIndexSize())
+                if (cfs.metric.maxRowSize.getValue() < DatabaseDescriptor.getColumnIndexSize())
                 {
                     logger.trace("Expanding slice filter to entire row to cover additional expressions");
                     return new SliceQueryFilter(ColumnSlice.ALL_COLUMNS_ARRAY, ((SliceQueryFilter)filter).reversed, Integer.MAX_VALUE);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 74b2c8e..111536c 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -673,7 +673,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         long now = System.currentTimeMillis();
         long nowNano = System.nanoTime();
 
-        long pending = ((JMXEnabledThreadPoolExecutor) StageManager.getStage(Stage.GOSSIP)).getPendingTasks();
+        long pending = ((JMXEnabledThreadPoolExecutor) StageManager.getStage(Stage.GOSSIP)).metrics.pendingTasks.getValue();
         if (pending > 0 && lastProcessedMessageAt < now - 1000)
         {
             // if some new messages just arrived, give the executor some time to work on them

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
index e4b714c..9d71a67 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -24,6 +24,8 @@ import java.net.UnknownHostException;
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
+
+import com.codahale.metrics.ExponentiallyDecayingReservoir;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
@@ -33,7 +35,6 @@ import org.apache.cassandra.net.MessagingService;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.utils.FBUtilities;
 
-import com.yammer.metrics.stats.ExponentiallyDecayingSample;
 
 /**
  * A dynamic snitch that sorts endpoints by latency with an adapted phi failure detector
@@ -55,7 +56,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
     private boolean registered = false;
 
     private final ConcurrentHashMap<InetAddress, Double> scores = new ConcurrentHashMap<InetAddress, Double>();
-    private final ConcurrentHashMap<InetAddress, ExponentiallyDecayingSample> samples = new ConcurrentHashMap<InetAddress, ExponentiallyDecayingSample>();
+    private final ConcurrentHashMap<InetAddress, ExponentiallyDecayingReservoir> samples = new ConcurrentHashMap<>();
 
     public final IEndpointSnitch subsnitch;
 
@@ -217,10 +218,10 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
 
     public void receiveTiming(InetAddress host, long latency) // this is cheap
     {
-        ExponentiallyDecayingSample sample = samples.get(host);
+        ExponentiallyDecayingReservoir sample = samples.get(host);
         if (sample == null)
         {
-            ExponentiallyDecayingSample maybeNewSample = new ExponentiallyDecayingSample(WINDOW_SIZE, ALPHA);
+            ExponentiallyDecayingReservoir maybeNewSample = new ExponentiallyDecayingReservoir(WINDOW_SIZE, ALPHA);
             sample = samples.putIfAbsent(host, maybeNewSample);
             if (sample == null)
                 sample = maybeNewSample;
@@ -244,14 +245,14 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
         double maxLatency = 1;
         // We're going to weight the latency for each host against the worst one we see, to
         // arrive at sort of a 'badness percentage' for them. First, find the worst for each:
-        for (Map.Entry<InetAddress, ExponentiallyDecayingSample> entry : samples.entrySet())
+        for (Map.Entry<InetAddress, ExponentiallyDecayingReservoir> entry : samples.entrySet())
         {
             double mean = entry.getValue().getSnapshot().getMedian();
             if (mean > maxLatency)
                 maxLatency = mean;
         }
         // now make another pass to do the weighting based on the maximums we found before
-        for (Map.Entry<InetAddress, ExponentiallyDecayingSample> entry: samples.entrySet())
+        for (Map.Entry<InetAddress, ExponentiallyDecayingReservoir> entry: samples.entrySet())
         {
             double score = entry.getValue().getSnapshot().getMedian() / maxLatency;
             // finally, add the severity without any weighting, since hosts scale this relative to their own load and the size of the task causing the severity.
@@ -265,8 +266,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
 
     private void reset()
     {
-        for (ExponentiallyDecayingSample sample : samples.values())
-            sample.clear();
+       samples.clear();
     }
 
     public Map<InetAddress, Double> getScores()
@@ -295,7 +295,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
     {
         InetAddress host = InetAddress.getByName(hostname);
         ArrayList<Double> timings = new ArrayList<Double>();
-        ExponentiallyDecayingSample sample = samples.get(host);
+        ExponentiallyDecayingReservoir sample = samples.get(host);
         if (sample != null)
         {
             for (double time: sample.getSnapshot().getValues())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java b/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java
index 3210d45..e6f2b81 100644
--- a/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/CASClientRequestMetrics.java
@@ -18,12 +18,14 @@
  */
 package org.apache.cassandra.metrics;
 
-import com.yammer.metrics.*;
-import com.yammer.metrics.core.*;
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.Histogram;
+
+import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
+
 
 public class CASClientRequestMetrics extends ClientRequestMetrics
 {
-
     public final Histogram contention;
     /* Used only for write  */
     public final Counter conditionNotMet;
@@ -32,16 +34,16 @@ public class CASClientRequestMetrics extends ClientRequestMetrics
 
     public CASClientRequestMetrics(String scope) {
         super(scope);
-        contention = Metrics.newHistogram(factory.createMetricName("ContentionHistogram"), true);
-        conditionNotMet =  Metrics.newCounter(factory.createMetricName("ConditionNotMet"));
-        unfinishedCommit =  Metrics.newCounter(factory.createMetricName("UnfinishedCommit"));
+        contention = Metrics.histogram(factory.createMetricName("ContentionHistogram"));
+        conditionNotMet =  Metrics.counter(factory.createMetricName("ConditionNotMet"));
+        unfinishedCommit =  Metrics.counter(factory.createMetricName("UnfinishedCommit"));
     }
 
     public void release()
     {
         super.release();
-        Metrics.defaultRegistry().removeMetric(factory.createMetricName("ContentionHistogram"));
-        Metrics.defaultRegistry().removeMetric(factory.createMetricName("ConditionNotMet"));
-        Metrics.defaultRegistry().removeMetric(factory.createMetricName("UnfinishedCommit"));
+        Metrics.remove(factory.createMetricName("ContentionHistogram"));
+        Metrics.remove(factory.createMetricName("ConditionNotMet"));
+        Metrics.remove(factory.createMetricName("UnfinishedCommit"));
     }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/metrics/CQLMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/CQLMetrics.java b/src/java/org/apache/cassandra/metrics/CQLMetrics.java
index a7076dd..1020e92 100644
--- a/src/java/org/apache/cassandra/metrics/CQLMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/CQLMetrics.java
@@ -17,11 +17,12 @@
  */
 package org.apache.cassandra.metrics;
 
+import com.codahale.metrics.Counter;
+import com.codahale.metrics.Gauge;
+import com.codahale.metrics.RatioGauge;
 import org.apache.cassandra.cql3.QueryProcessor;
-import com.yammer.metrics.Metrics;
-import com.yammer.metrics.core.Counter;
-import com.yammer.metrics.core.Gauge;
-import com.yammer.metrics.util.RatioGauge;
+
+import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
 
 public class CQLMetrics
 {
@@ -36,27 +37,32 @@ public class CQLMetrics
 
     public CQLMetrics()
     {
-        regularStatementsExecuted = Metrics.newCounter(factory.createMetricName("RegularStatementsExecuted"));
-        preparedStatementsExecuted = Metrics.newCounter(factory.createMetricName("PreparedStatementsExecuted"));
-        preparedStatementsEvicted = Metrics.newCounter(factory.createMetricName("PreparedStatementsEvicted"));
+        regularStatementsExecuted = Metrics.counter(factory.createMetricName("RegularStatementsExecuted"));
+        preparedStatementsExecuted = Metrics.counter(factory.createMetricName("PreparedStatementsExecuted"));
+        preparedStatementsEvicted = Metrics.counter(factory.createMetricName("PreparedStatementsEvicted"));
 
-        preparedStatementsCount = Metrics.newGauge(factory.createMetricName("PreparedStatementsCount"), new Gauge<Integer>()
+        preparedStatementsCount = Metrics.register(factory.createMetricName("PreparedStatementsCount"), new Gauge<Integer>()
         {
-            public Integer value()
+            public Integer getValue()
             {
                 return QueryProcessor.preparedStatementsCount();
             }
         });
-        preparedStatementsRatio = Metrics.newGauge(factory.createMetricName("PreparedStatementsRatio"), new RatioGauge()
+        preparedStatementsRatio = Metrics.register(factory.createMetricName("PreparedStatementsRatio"), new RatioGauge()
         {
+            public Ratio getRatio()
+            {
+                return Ratio.of(getNumerator(), getDenominator());
+            }
+
             public double getNumerator()
             {
-                return preparedStatementsExecuted.count();
+                return preparedStatementsExecuted.getCount();
             }
 
             public double getDenominator()
             {
-                return regularStatementsExecuted.count() + preparedStatementsExecuted.count();
+                return regularStatementsExecuted.getCount() + preparedStatementsExecuted.getCount();
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8896a70b/src/java/org/apache/cassandra/metrics/CacheMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/CacheMetrics.java b/src/java/org/apache/cassandra/metrics/CacheMetrics.java
index 9d5d783..8b00e1c 100644
--- a/src/java/org/apache/cassandra/metrics/CacheMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/CacheMetrics.java
@@ -17,16 +17,15 @@
  */
 package org.apache.cassandra.metrics;
 
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
-import com.yammer.metrics.Metrics;
-import com.yammer.metrics.core.Gauge;
-import com.yammer.metrics.core.Meter;
-import com.yammer.metrics.util.RatioGauge;
-
+import com.codahale.metrics.Gauge;
+import com.codahale.metrics.Meter;
+import com.codahale.metrics.RatioGauge;
 import org.apache.cassandra.cache.ICache;
 
+import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
+
 /**
  * Metrics for {@code ICache}.
  */
@@ -45,9 +44,6 @@ public class CacheMetrics
     /** Total number of cache entries */
     public final Gauge<Integer> entries;
 
-    private final AtomicLong lastRequests = new AtomicLong(0);
-    private final AtomicLong lastHits = new AtomicLong(0);
-
     /**
      * Create metrics for given cache.
      *
@@ -58,57 +54,36 @@ public class CacheMetrics
     {
         MetricNameFactory factory = new DefaultNameFactory("Cache", type);
 
-        capacity = Metrics.newGauge(factory.createMetricName("Capacity"), new Gauge<Long>()
+        capacity = Metrics.register(factory.createMetricName("Capacity"), new Gauge<Long>()
         {
-            public Long value()
+            public Long getValue()
             {
                 return cache.capacity();
             }
         });
-        hits = Metrics.newMeter(factory.createMetricName("Hits"), "hits", TimeUnit.SECONDS);
-        requests = Metrics.newMeter(factory.createMetricName("Requests"), "requests", TimeUnit.SECONDS);
-        hitRate = Metrics.newGauge(factory.createMetricName("HitRate"), new RatioGauge()
+        hits = Metrics.meter(factory.createMetricName("Hits"));
+        requests = Metrics.meter(factory.createMetricName("Requests"));
+        hitRate = Metrics.register(factory.createMetricName("HitRate"), new RatioGauge()
         {
-            protected double getNumerator()
-            {
-                return hits.count();
-            }
-
-            protected double getDenominator()
+            @Override
+            public Ratio getRatio()
             {
-                return requests.count();
+                return Ratio.of(hits.getCount(), requests.getCount());
             }
         });
-        size = Metrics.newGauge(factory.createMetricName("Size"), new Gauge<Long>()
+        size = Metrics.register(factory.createMetricName("Size"), new Gauge<Long>()
         {
-            public Long value()
+            public Long getValue()
             {
                 return cache.weightedSize();
             }
         });
-        entries = Metrics.newGauge(factory.createMetricName("Entries"), new Gauge<Integer>()
+        entries = Metrics.register(factory.createMetricName("Entries"), new Gauge<Integer>()
         {
-            public Integer value()
+            public Integer getValue()
             {
                 return cache.size();
             }
         });
     }
-
-    // for backward compatibility
-    @Deprecated
-    public double getRecentHitRate()
-    {
-        long r = requests.count();
-        long h = hits.count();
-        try
-        {
-            return ((double)(h - lastHits.get())) / (r - lastRequests.get());
-        }
-        finally
-        {
-            lastRequests.set(r);
-            lastHits.set(h);
-        }
-    }
 }


Mime
View raw message