Search in sources :

Example 1 with MetricToJsonVisitor

use of org.platformlayer.client.cli.output.MetricToJsonVisitor in project platformlayer by platformlayer.

the class GetMetric method formatRaw.

@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);
    }
}
Also used : IOException(java.io.IOException) MetricToJsonVisitor(org.platformlayer.client.cli.output.MetricToJsonVisitor) MetricDataStream(org.platformlayer.metrics.model.MetricDataStream)

Aggregations

IOException (java.io.IOException)1 MetricToJsonVisitor (org.platformlayer.client.cli.output.MetricToJsonVisitor)1 MetricDataStream (org.platformlayer.metrics.model.MetricDataStream)1