@Override
public void formatRaw(Object o, PrintWriter writer) {
MetricDataStream dataStream = (MetricDataStream) o;
try {
MetricToJsonVisitor visitor = new MetricToJsonVisitor(writer);
dataStream.accept(visitor);
visitor.close();
} catch (IOException e) {
throw new IllegalArgumentException("Error formatting results", e);
}
}