source.getAggregation())); argv.add(String.format("XPORT:%s:%s", tempLabel, tempLabel));
source.getAggregation())); argv.add(String.format("XPORT:%s:%s", tempLabel, tempLabel));
final String rrdFile = entry.getValue(); dproc.addDatasource(source.getLabel(), rrdFile, source.getEffectiveDataSource(), source.getAggregation());
final String rrdFile = entry.getValue(); dproc.addDatasource(source.getLabel(), rrdFile, source.getEffectiveDataSource(), source.getAggregation());
@Override public Collection<Row<Measurement>> call() throws Exception { ResultDescriptor resultDescriptor = new ResultDescriptor(lag.getInterval()); for (Source source : listOfSources) { // Use the datasource as the metric name if set, otherwise use the name of the attribute final String metricName = source.getDataSource() != null ? source.getDataSource() : source.getAttribute(); final String name = source.getLabel(); final AggregationFunction fn = toAggregationFunction(source.getAggregation()); resultDescriptor.datasource(name, metricName, lag.getHeartbeat(), fn); resultDescriptor.export(name); } LOG.debug("Querying Newts for resource id {} with result descriptor: {}", newtsResourceId, resultDescriptor); Results<Measurement> results = m_sampleRepository.select(m_context, new Resource(newtsResourceId), start, end, resultDescriptor, Optional.of(Duration.millis(lag.getStep())), limitConcurrentAggregationsCallback); Collection<Row<Measurement>> rows = results.getRows(); LOG.debug("Found {} rows.", rows.size()); return rows; } };
@Override public Collection<Row<Measurement>> call() throws Exception { ResultDescriptor resultDescriptor = new ResultDescriptor(lag.getInterval()); for (Source source : listOfSources) { // Use the datasource as the metric name if set, otherwise use the name of the attribute final String metricName = source.getDataSource() != null ? source.getDataSource() : source.getAttribute(); final String name = source.getLabel(); final AggregationFunction fn = toAggregationFunction(source.getAggregation()); resultDescriptor.datasource(name, metricName, lag.getHeartbeat(), fn); resultDescriptor.export(name); } LOG.debug("Querying Newts for resource id {} with result descriptor: {}", newtsResourceId, resultDescriptor); Results<Measurement> results = m_sampleRepository.select(m_context, new Resource(newtsResourceId), start, end, resultDescriptor, Optional.of(Duration.millis(lag.getStep())), limitConcurrentAggregationsCallback); Collection<Row<Measurement>> rows = results.getRows(); LOG.debug("Found {} rows.", rows.size()); return rows; } };
source.getAggregation())); cmdLine.addArgument(String.format("XPORT:%s:%s", tempLabel, tempLabel));
source.getAggregation())); cmdLine.addArgument(String.format("XPORT:%s:%s", tempLabel, tempLabel));
|| source.getAttribute() == null || source.getLabel() == null || source.getAggregation() == null) { throw new ValidationException("Query source fields must be set: {}", source);
|| source.getAttribute() == null || source.getLabel() == null || source.getAggregation() == null) { throw new ValidationException("Query source fields must be set: {}", source);