You can use custom masks to limit the number of digits rendered. See below for how to achieve this |
Using Masks is a way of addressing this but it has some undocumented features. package com.itrsgroup.jmx.masks; public class geneosFormat implements Mask { public String get(Object data, String[] args) throws MaskException { String r; try { r = String.format(args[ 0 ], Float.parseFloat((String) data)); } catch (Exception e) { throw new MaskException( "whoops" ); } return r; } } Create a file that must have the same name as the class but with a .java extension ("geneosFormat.java"), then compile it using javac -d . -classpath .../geneos-plugins.jar geneosFormat.java
This will create a hierarchy in the current directory, e.g. com/itrsgroup/jmx/masks, and put the geneosFormat.class file in there. Now build a .jar file using jar cvf custom-masks.jar com
... and delete the com directory or this will be used instead: rm -r com/
At this point, if your custom-masks.jar file in your netprobe directory (or the same place as the geneos-jars.jar at least), restart the NetProbe. Now, in the JMX sampler you have to enable Masks for all rows or columns using the IGNORE Mask type and then add this one to the field you want to format, like this: The full text for the Mask above is This will now render the field with 2 decimal places.
|
Comments
0 comments
Please sign in to leave a comment.