Package org.rhq.server.metrics.domain

Examples of org.rhq.server.metrics.domain.AggregateNumericMetricMapper


            StorageResultSetFuture f = metricsDAO
                .findAggregateMetricsAsync(pk.getScheduleId(), Bucket.ONE_HOUR, pk.getTimestamp(), pk.getTimestamp() + 1);
            futureResults.add(f);
        }

        AggregateNumericMetricMapper mapper = new AggregateNumericMetricMapper();

        List<AggregateNumericMetric> result = new ArrayList<AggregateNumericMetric>(pks.size());
        for (StorageResultSetFuture f : futureResults) {
            ResultSet r = f.get();

            // this should always get exactly 1 row
            if (!r.isExhausted()) {
                AggregateNumericMetric aggregate = mapper.mapOne(r);
                result.add(aggregate);
            }
        }

        return result;
View Full Code Here


    public void setBucket(IndexBucket bucket) {
        this.bucket = bucket;
        if (bucket == IndexBucket.RAW) {
            resultSetMapper = new RawNumericMetricMapper();
        } else {
            resultSetMapper = new AggregateNumericMetricMapper();
        }
    }
View Full Code Here

    public List<AggregateNumericMetric> findAggregateMetrics(int scheduleId, Bucket bucket, long startTime,
        long endTime) {
        BoundStatement statement = findAggregateMetricsByDateRange.bind(scheduleId, bucket.toString(),
            new Date(startTime), new Date(endTime));
        ResultSet resultSet = storageSession.execute(statement);
        AggregateNumericMetricMapper mapper = new AggregateNumericMetricMapper();
        return mapper.mapAll(resultSet);
    }
View Full Code Here

            "WHERE schedule_id = ? AND bucket = ? " +
            "ORDER BY time, type";
        PreparedStatement statement = session.prepare(cql);
        BoundStatement boundStatement = statement.bind(scheduleId, bucket.toString());

        return new SimplePagedResult<AggregateNumericMetric>(boundStatement, new AggregateNumericMetricMapper(),
            storageSession);
    }
View Full Code Here

            futures.add(dao.findAggregateMetricsAsync(scheduleId, bucket, begin, end));
        }
        ListenableFuture<List<ResultSet>> resultSetsFuture = Futures.successfulAsList(futures);
        try {
            List<ResultSet> resultSets = resultSetsFuture.get();
            AggregateNumericMetricMapper mapper = new AggregateNumericMetricMapper();
            List<AggregateNumericMetric> metrics = new ArrayList<AggregateNumericMetric>();
            for (ResultSet resultSet : resultSets) {
                metrics.addAll(mapper.mapAll(resultSet));
            }
            return metrics;
        } catch (Exception e) {
            log.warn("There was an error while fetching " + bucket + " data for {scheduleIds: " + scheduleIds +
                ", beginTime: " + begin + ", endTime: " + end + "}", e);
View Full Code Here

    private Bucket bucket;

    public ComputeAggregate(long timestamp, Bucket bucket) {
        this.timestamp = timestamp;
        this.bucket = bucket;
        mapper = new AggregateNumericMetricMapper();
    }
View Full Code Here

TOP

Related Classes of org.rhq.server.metrics.domain.AggregateNumericMetricMapper

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.