cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Jmx attributes filtered to get only one metric out of many in a Bean

Hi everybody,

This is my very first post on this forum.
We have just installed a few neo4j databases in production (community edition, version 3.5.3) and I would like to get a few metrics through the jmx technology.
If I know now how to grab all the metrics in a particular Bean (containing just a few metrics, Kernel for instance), I would like to grab only one metrics in another Bean (containing too many metrics such as Configuration).
For that purpose, I would like to use either the WITH or the CASE clause just like in the following examples :

EXAMPLE#1

CALL dbms.queryJmx("org.neo4j:instance=kernel#0,name=Configuration") yield attributes with keys(attributes) as k, attributes unwind k as row with k, row as r where r CONTAINS 'dbms.checkpoint.interval.time' return r;

+---------------------------------+
| r |
+---------------------------------+
| "dbms.checkpoint.interval.time" |
+---------------------------------+

In the previous example, I get the name of the metrics but not the value of it.

EXAMPLE #2

CALL dbms.queryJmx("org.neo4j:instance=kernel#0,name=Configuration") yield attributes with keys(attributes) as k, attributes unwind k as row return row, case when row = 'dbms.checkpoint.interval.time' then attributes[row]["value"] else null end as value;

| "dbms.security.http_access_control_allow_origin" | NULL |
| "dbms.checkpoint.interval.time" | "900000ms" |
| "unsupported.dbms.db.spatial.crs.cartesian-3d.z.min" | NULL |

In the second example, I have got all the metrics with NULL values but for the one I am interested in.

Could you help me find the right syntax to get only one metric out of many in a Bean and thus display only the following line :

| "dbms.checkpoint.interval.time" | "900000ms" |

Thank you in advance.

Jean-michel, Nemours, France

0 REPLIES 0