Package com.rackspacecloud.blueflood.outputs.formats

Examples of com.rackspacecloud.blueflood.outputs.formats.MetricData


    }
   
    @Test
    public void testCounters() throws Exception {
        final JSONBasicRollupsOutputSerializer serializer = new JSONBasicRollupsOutputSerializer();
        final MetricData metricData = new MetricData(
                FakeMetricDataGenerator.generateFakeCounterRollupPoints(),
                "unknown",
                MetricData.Type.NUMBER);
        JSONObject metricDataJSON = serializer.transformRollupData(metricData, PlotRequestParser.DEFAULT_COUNTER);
        final JSONArray data = (JSONArray)metricDataJSON.get("values");
View Full Code Here


    }
   
    @Test
    public void testGauges() throws Exception {
        final JSONBasicRollupsOutputSerializer serializer = new JSONBasicRollupsOutputSerializer();
        final MetricData metricData = new MetricData(
                FakeMetricDataGenerator.generateFakeGaugeRollups(),
                "unknown",
                MetricData.Type.NUMBER);
        JSONObject metricDataJSON = serializer.transformRollupData(metricData, PlotRequestParser.DEFAULT_GAUGE);
        final JSONArray data = (JSONArray)metricDataJSON.get("values");
View Full Code Here

    }
   
    @Test
    public void testSets() throws Exception {
        final JSONBasicRollupsOutputSerializer serializer = new JSONBasicRollupsOutputSerializer();
        final MetricData metricData = new MetricData(
                FakeMetricDataGenerator.generateFakeSetRollupPoints(),
                "unknown",
                MetricData.Type.NUMBER);
        JSONObject metricDataJSON = serializer.transformRollupData(metricData, PlotRequestParser.DEFAULT_SET);
        final JSONArray data = (JSONArray)metricDataJSON.get("values");
View Full Code Here

    }
   
    @Test
    public void setTimers() throws Exception {
        final JSONBasicRollupsOutputSerializer serializer = new JSONBasicRollupsOutputSerializer();
        final MetricData metricData = new MetricData(
                FakeMetricDataGenerator.generateFakeTimerRollups(),
                "unknown",
                MetricData.Type.NUMBER);
       
        JSONObject metricDataJSON = serializer.transformRollupData(metricData, PlotRequestParser.DEFAULT_TIMER);
View Full Code Here

        }

        System.out.println("Locator: " + locator + ", from: " + from + ", to: "
                + to + ", resolution: " + gran.shortName());

        MetricData data = reader.getDatapointsForRange(locator, new Range(from, to), gran);
        Map<Long, Points.Point> points = data.getData().getPoints();
        for (Map.Entry<Long, Points.Point> item : points.entrySet()) {
            String output = String.format("Timestamp: %d, Data: %s, Unit: %s", item.getKey(), item.getValue().getData().toString(), data.getUnit());
            System.out.println(output);
        }
    }
View Full Code Here

        // Use the same executor. We shouldn't see issues.
        results = batchMetricsQueryHandler.execute(query, new TimeValue(5, TimeUnit.SECONDS));
        Assert.assertEquals(locators.size(), results.size());

        for (Map.Entry<Locator, MetricData> item : results.entrySet()) {
            MetricData data = item.getValue();
            Assert.assertEquals((int) answers.get(item.getKey()).get(gran), data.getData().getPoints().size());
        }
    }
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.outputs.formats.MetricData

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.