public static FetchResults createEmtpyFetchResults(final long step, final Map<String, Object> constants) { final Map<String, double[]> columns = new HashMap<>(); return new FetchResults(new long[0], columns, step, constants); } }
/** * Enrich the <code>fetchResults</code> with NaN values for all <code>sources</code> which do not have values in the <code>fetchResults</code>. * * @param fetchResults * @param sources */ public static void fillMissingValues(FetchResults fetchResults, List<Source> sources) { Objects.requireNonNull(fetchResults); Objects.requireNonNull(sources); final int rowCount = fetchResults.getTimestamps().length; for (Source eachSource : sources) { if (!fetchResults.getColumns().containsKey(eachSource.getLabel())) { fetchResults.getColumns().put(eachSource.getLabel(), createNaNArray(rowCount)); } } }
RowSortedTable<Long, String, Double> table = results.asRowSortedTable(); filterEngine.filter(request.getFilters(), table); results = new FetchResults(table, results.getStep(), results.getConstants(), results.getMetadata()); final Map<String, double[]> columns = results.getColumns(); for (final Source source : request.getSources()) { if (source.getTransient()) { response.setStart(request.getStart()); response.setEnd(request.getEnd()); response.setStep(results.getStep()); response.setTimestamps(results.getTimestamps()); response.setColumns(results.getColumns()); response.setConstants(results.getConstants()); response.setMetadata(results.getMetadata()); return response;
jexlValues.putAll(results.getConstants()); LOG.debug("JEXL context constants: {}", jexlValues); jexl.getFunctions().put("jexl", jexlEvaluateFunctions); final long timestamps[] = results.getTimestamps(); final Map<String, double[]> columns = results.getColumns(); final int numRows = timestamps.length;
final double[] statistics = results.getColumns().get(source.getLabel()); if (statistics == null || statistics.length == 0) { LOG.warn("Statistic is empty: {}", source);
RowSortedTable<Long, String, Double> table = results.asRowSortedTable(); filterEngine.filter(request.getFilters(), table); results = new FetchResults(table, results.getStep(), results.getConstants()); final Map<String, double[]> columns = results.getColumns(); for (final Source source : request.getSources()) { if (source.getTransient()) { response.setStart(request.getStart()); response.setEnd(request.getEnd()); response.setStep(results.getStep()); response.setTimestamps(results.getTimestamps()); response.setColumns(results.getColumns()); response.setConstants(results.getConstants()); return response;
jexlValues.putAll(results.getConstants()); LOG.debug("JEXL context constants: {}", jexlValues); jexl.getFunctions().put("jexl", jexlEvaluateFunctions); final long timestamps[] = results.getTimestamps(); final Map<String, double[]> columns = results.getColumns(); final int numRows = timestamps.length;
public static FetchResults createEmtpyFetchResults(final long step, final Map<String, Object> constants) { final Map<String, double[]> columns = new HashMap<>(); return new FetchResults(new long[0], columns, step, constants, new QueryMetadata()); } }
/** * Enrich the <code>fetchResults</code> with NaN values for all <code>sources</code> which do not have values in the <code>fetchResults</code>. * * @param fetchResults * @param sources */ public static void fillMissingValues(FetchResults fetchResults, List<Source> sources) { Objects.requireNonNull(fetchResults); Objects.requireNonNull(sources); final int rowCount = fetchResults.getTimestamps().length; for (Source eachSource : sources) { if (!fetchResults.getColumns().containsKey(eachSource.getLabel())) { fetchResults.getColumns().put(eachSource.getLabel(), createNaNArray(rowCount)); } } }
return new FetchResults(timestamps, valuesByLabel, xportResults.getStep() * 1000, constants);
return new FetchResults(timestamps, valuesByLabel, xportResults.getStep() * 1000, constants, metadata);
FetchResults fetchResults = new FetchResults(timestamps, columns, lag.getStep(), constants, new QueryMetadata(resources)); if (relaxed) { Utils.fillMissingValues(fetchResults, sources);
return new FetchResults(timestamps, columns, dproc.getStep() * 1000, constants, metadata);
FetchResults fetchResults = new FetchResults(timestamps, columns, lag.getStep(), constants); if (relaxed) { Utils.fillMissingValues(fetchResults, sources);
return new FetchResults(timestamps, columns, dproc.getStep() * 1000, constants);
return new FetchResults(timestamps, columns, xportStepInMs, constants, metadata);
return new FetchResults(timestamps, columns, xportStepInMs, constants);
source.setAttribute(rrdAttribute.getName()); source.setAggregation("AVERAGE"); FetchResults results = new FetchResults(new long[] {report.getStartTime()}, Collections.singletonMap("result", new double[] {100.0}), report.getEndTime() - report.getStartTime(),
source.setAttribute(rrdAttribute.getName()); source.setAggregation("AVERAGE"); FetchResults results = new FetchResults(new long[] {report.getStartTime()}, Collections.singletonMap("result", new double[] {100.0}), report.getEndTime() - report.getStartTime(),