Skip to content

Instantly share code, notes, and snippets.

@ms2scale
ms2scale / jmxtrans_graphitewriter_boolean_converter
Created October 18, 2013 11:50
Diff to enable the conversion of boolean values to numeric 0 (false) or 1 (true) in the jmxtrans GraphiteWriter output model.
diff --git a/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java b/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
index 5d04014..ab52ca9 100644
--- a/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
+++ b/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
@@ -155,7 +155,7 @@ public class GraphiteWriter extends BaseOutputWriter {
Map<String, Object> resultValues = result.getValues();
if (resultValues != null) {
for (Entry<String, Object> values : resultValues.entrySet()) {
- Object value = values.getValue();
+ Object value = convertToNumeric(values.getValue());