{"record":{"id":"fee6663280356e6c","repo":"apache/cassandra","slug":"unknown-bufferpool-metric-name","errorCode":null,"errorMessage":"Unknown BufferPool metric name ","messagePattern":"Unknown BufferPool metric name ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tools/NodeProbe.java","lineNumber":1940,"sourceCode":"    {\n        try\n        {\n            switch (metricName)\n            {\n                case \"UsedSize\":\n                case \"OverflowSize\":\n                case \"Capacity\":\n                case \"Size\":\n                    return JMX.newMBeanProxy(mbeanServerConn,\n                           new ObjectName(\"org.apache.cassandra.metrics:type=BufferPool,scope=\" + poolType + \",name=\" + metricName),\n                           CassandraMetricsRegistry.JmxGaugeMBean.class).getValue();\n                case \"Hits\":\n                case \"Misses\":\n                    return JMX.newMBeanProxy(mbeanServerConn,\n                    new ObjectName(\"org.apache.cassandra.metrics:type=BufferPool,scope=\" + poolType + \",name=\" + metricName),\n                    CassandraMetricsRegistry.JmxMeterMBean.class).getCount();\n                default:\n                    throw new RuntimeException(\"Unknown BufferPool metric name \" + metricName);\n            }\n        }\n        catch (MalformedObjectNameException e)\n        {\n            throw new RuntimeException(e);\n        }\n    }\n\n    /**\n     * Retrieve a CQL metric value by name. Works generically for any metric registered under\n     * {@code org.apache.cassandra.metrics:type=CQL,name=<metricName>} by inspecting the MBean\n     * attributes at runtime, without requiring knowledge of the underlying metric type.\n     */\n    public Object getCQLMetric(String metricName)\n    {\n        try\n        {\n            ObjectName objectName = new ObjectName(DefaultNameFactory.GROUP_NAME + \":type=\" + CQLMetrics.TYPE_NAME + \",name=\" + metricName);","sourceCodeStart":1922,"sourceCodeEnd":1958,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tools/NodeProbe.java#L1922-L1958","documentation":"NodeProbe.getBufferPoolMetric(String poolType, String metricName) throws when metricName is not one of the handled buffer-pool metric names (e.g. Size, Capacity, Hits, Misses). The name is mapped to a JMX MBean under org.apache.cassandra.metrics:type=BufferPool and unknown names are rejected in the default branch.","triggerScenarios":"Running the nodetool buffer-pool metrics command with an unsupported metric name, e.g. 'Allocations' or 'size' (wrong case).","commonSituations":"Case-sensitivity mistakes; expecting metrics not exposed in the installed Cassandra version; scripting from documentation of a different release.","solutions":["Use a supported name exactly: Size, Capacity, Hits, Misses (per the switch cases in your version)","Check `nodetool help` output for the buffer pool metric options","Browse org.apache.cassandra.metrics:type=BufferPool MBeans in JMX to see available attributes"],"exampleFix":"// before\nObject v = probe.getBufferPoolMetric(\"chunk-cache\", \"Allocations\");\n// after\nObject v = probe.getBufferPoolMetric(\"chunk-cache\", \"Hits\");","handlingStrategy":"validation","validationCode":"java.util.Set<String> VALID = Set.of(\"Size\",\"Capacity\",\"Hits\",\"Misses\");\nif (!VALID.contains(metricName)) throw new IllegalArgumentException(\"Unknown BufferPool metric: \" + metricName);","typeGuard":null,"tryCatchPattern":"try { return probe.getBufferPoolMetric(poolType, metricName); } catch (RuntimeException e) { throw new IllegalArgumentException(\"Supported BufferPool metrics: Size, Capacity, Hits, Misses\", e); }","preventionTips":["Use exact case-sensitive metric names","Verify against nodetool help output on your Cassandra version","Check the BufferPool MBean attributes in JMX for the authoritative list"],"tags":["nodetool","cli-argument","jmx","metrics"],"backgroundTag":"invalid-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}