Search in sources :

Example 11 with TimeSeries

use of co.cask.cdap.api.dataset.lib.cube.TimeSeries in project cdap by caskdata.

the class DefaultMetricStore method query.

@Override
public Collection<MetricTimeSeries> query(MetricDataQuery query) {
    Collection<TimeSeries> cubeResult = cube.get().query(buildCubeQuery(query));
    List<MetricTimeSeries> result = Lists.newArrayList();
    for (TimeSeries timeSeries : cubeResult) {
        result.add(new MetricTimeSeries(timeSeries.getMeasureName(), timeSeries.getDimensionValues(), timeSeries.getTimeValues()));
    }
    return result;
}
Also used : MetricTimeSeries(co.cask.cdap.api.metrics.MetricTimeSeries) TimeSeries(co.cask.cdap.api.dataset.lib.cube.TimeSeries) MetricTimeSeries(co.cask.cdap.api.metrics.MetricTimeSeries)

Aggregations

TimeSeries (co.cask.cdap.api.dataset.lib.cube.TimeSeries)11 Test (org.junit.Test)6 Cube (co.cask.cdap.api.dataset.lib.cube.Cube)5 TimeValue (co.cask.cdap.api.dataset.lib.cube.TimeValue)3 CubeDeleteQuery (co.cask.cdap.api.dataset.lib.cube.CubeDeleteQuery)2 CubeQuery (co.cask.cdap.api.dataset.lib.cube.CubeQuery)2 DimensionValue (co.cask.cdap.api.dataset.lib.cube.DimensionValue)2 URL (java.net.URL)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 CubeExploreQuery (co.cask.cdap.api.dataset.lib.cube.CubeExploreQuery)1 CubeFact (co.cask.cdap.api.dataset.lib.cube.CubeFact)1 Interpolators (co.cask.cdap.api.dataset.lib.cube.Interpolators)1 MetricTimeSeries (co.cask.cdap.api.metrics.MetricTimeSeries)1 FactScan (co.cask.cdap.data2.dataset2.lib.timeseries.FactScan)1 FactScanner (co.cask.cdap.data2.dataset2.lib.timeseries.FactScanner)1 FactTable (co.cask.cdap.data2.dataset2.lib.timeseries.FactTable)1 ApplicationManager (co.cask.cdap.test.ApplicationManager)1 ServiceManager (co.cask.cdap.test.ServiceManager)1 HttpRequest (co.cask.common.http.HttpRequest)1