Search in sources :

Example 1 with MetricQuery

use of org.platformlayer.metrics.model.MetricQuery in project platformlayer by platformlayer.

the class FederatedPlatformLayerClient method getMetric.

@Override
public MetricDataStream getMetric(MetricQuery query) throws PlatformLayerClientException {
    MappedPlatformLayerKey mapped = mapToChild(query.item);
    MetricQuery mappedQuery = query.copy();
    mappedQuery.item = mapped.key;
    return mapped.child.client.getMetric(mappedQuery);
}
Also used : MetricQuery(org.platformlayer.metrics.model.MetricQuery)

Example 2 with MetricQuery

use of org.platformlayer.metrics.model.MetricQuery in project platformlayer by platformlayer.

the class GetMetric method runCommand.

@Override
public Object runCommand() throws PlatformLayerClientException {
    PlatformLayerClient client = getPlatformLayerClient();
    MetricQuery query = new MetricQuery();
    query.item = getContext().pathToItem(getProject(), path);
    if (filters != null) {
        query.filters.addAll(filters);
    }
    if (projections != null) {
        query.projections.addAll(projections);
    }
    query.setFlatten(flatten);
    MetricDataStream dataStream = client.getMetric(query);
    return dataStream;
}
Also used : PlatformLayerClient(org.platformlayer.PlatformLayerClient) MetricQuery(org.platformlayer.metrics.model.MetricQuery) MetricDataStream(org.platformlayer.metrics.model.MetricDataStream)

Aggregations

MetricQuery (org.platformlayer.metrics.model.MetricQuery)2 PlatformLayerClient (org.platformlayer.PlatformLayerClient)1 MetricDataStream (org.platformlayer.metrics.model.MetricDataStream)1