Package org.platformlayer.metrics.model

Examples of org.platformlayer.metrics.model.MetricDataStream


      query.projections.addAll(projections);
    }

    query.setFlatten(flatten);

    MetricDataStream dataStream = client.getMetric(query);

    return dataStream;
  }
View Full Code Here


    return dataStream;
  }

  @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);
    }
  }
View Full Code Here

  public MetricDataStream getMetric(MetricQuery query) throws PlatformLayerClientException {
    String relativePath = buildRelativePath(query.item) + "/metrics";

    StreamingResponse response = doRequest(HttpMethod.POST, relativePath, StreamingResponse.class, Format.JSON,
        query, Format.XML);
    MetricDataStream dataStream;
    try {
      dataStream = JsonMetricDataStream.build(response.getResponseStream());
      response = null; // Don't close yet
    } catch (IOException e) {
      throw new PlatformLayerClientException("Error parsing returned data", e);
View Full Code Here

TOP

Related Classes of org.platformlayer.metrics.model.MetricDataStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.