Package com.rackspacecloud.blueflood.types

Examples of com.rackspacecloud.blueflood.types.Metric


    public static Collection<Metric> remarshal(Collection<BasicMetric> basicMetrics, String tenantId) {
        List<Metric> metrics = new ArrayList<Metric>(basicMetrics.size());
        for (BasicMetric bm : basicMetrics) {
            String appliedTenantId = tenantId == null ? bm.getTenant() : tenantId;
            Locator locator = Locator.createLocatorFromPathComponents(appliedTenantId, splitForLocator(bm.getMetricName()));
            Metric m = new Metric(locator, bm.getMetricValue(), bm.getCollectionTime(), new TimeValue(bm.getTtlInSeconds(), TimeUnit.SECONDS), bm.getUnit());
            metrics.add(m);
        }
        return metrics;
    }
View Full Code Here


            } else {
                locator = Locator.createLocatorFromPathComponents(tenantId, jsonMetric.getMetricName());
            }

            if (jsonMetric.getMetricValue() != null) {
                final Metric metric = new Metric(locator, jsonMetric.getMetricValue(), jsonMetric.getCollectionTime(),
                        new TimeValue(jsonMetric.getTtlInSeconds(), TimeUnit.SECONDS), jsonMetric.getUnit());
                metrics.add(metric);
            }
        }
View Full Code Here

                value = in.readRawVarint64();
            else if (type.equals(DataType.STRING))
                value = in.readString();
           
            if (value != null) {
                metrics.add(new Metric(
                        Locator.createLocatorFromPathComponents(tenantId, metricName),
                        value,
                        collectionTime,
                        new TimeValue(ttlSecs, TimeUnit.SECONDS),
                        units));
View Full Code Here

    // create a random int metric.
    private static Collection<Metric> nextMetrics(Locator locator, int count) {
        List<Metric> metrics = new ArrayList<Metric>(count);
        for (int i = 0; i < count; i++) {
            metrics.add(new Metric(locator, rand.nextInt(1024), System.currentTimeMillis(), TTL, "gigawatts"));
        }
        log.info("Generating metrics for {} until {}", locator, System.currentTimeMillis());
        return metrics;
    }
View Full Code Here

        // insert something every 1m for 24h
        for (int i = 0; i < 1440; i++) {
            final long curMillis = baseMillis + i * 60000;
            final List<Metric> metrics = new ArrayList<Metric>();
            final Metric metric = getRandomIntMetric(locators.get(0), curMillis);
            final Metric stringMetric = getRandomStringmetric(locators.get(1), curMillis);
            metrics.add(metric);
            metrics.add(stringMetric);

            analyzer.scanMetrics(new ArrayList<IMetric>(metrics));
            writer.insertFull(metrics);
View Full Code Here

TOP

Related Classes of com.rackspacecloud.blueflood.types.Metric

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.