public double[] getSnapshots() { double[] result; int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; if (filter != FILTER_NONE && resultSize > 1) { long[] timestamps = null; if (filter == FILTER_PERSEC) { timestamps = resource.getAllRawTimeStamps(); } result = new double[resultSize-1]; int tsIdx = resource.getFirstTimeStampIdx()+startIdx; double[] values = series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); for (int i=0; i < result.length; i++) { double valueDelta = values[i+1] - values[i]; if (filter == FILTER_PERSEC) { double timeDelta = (timestamps[tsIdx+i+1] - timestamps[tsIdx+i]); // millis valueDelta /= (timeDelta / 1000); // per second } result[i] = valueDelta; } } else { result = series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); } calcStats(result); return result; }
public double[] getSnapshots() { double[] result; int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; if (filter != FILTER_NONE && resultSize > 1) { long[] timestamps = null; if (filter == FILTER_PERSEC) { timestamps = resource.getAllRawTimeStamps(); } result = new double[resultSize-1]; int tsIdx = resource.getFirstTimeStampIdx()+startIdx; double[] values = series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); for (int i=0; i < result.length; i++) { double valueDelta = values[i+1] - values[i]; if (filter == FILTER_PERSEC) { double timeDelta = (timestamps[tsIdx+i+1] - timestamps[tsIdx+i]); // millis valueDelta /= (timeDelta / 1000); // per second } result[i] = valueDelta; } } else { result = series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); } calcStats(result); return result; }
public long[] getRawAbsoluteTimeStamps() { int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; if (resultSize <= 0) { return new long[0]; } else { long[] result = new long[resultSize]; long[] timestamps = resource.getAllRawTimeStamps(); int tsIdx = resource.getFirstTimeStampIdx()+startIdx; long base = resource.getTimeBase(); for (int i=0; i < resultSize; i++) { result[i] = base + timestamps[tsIdx+i]; } return result; } }
public long[] getRawAbsoluteTimeStamps() { int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; if (resultSize <= 0) { return new long[0]; } else { long[] result = new long[resultSize]; long[] timestamps = resource.getAllRawTimeStamps(); int tsIdx = resource.getFirstTimeStampIdx()+startIdx; long base = resource.getTimeBase(); for (int i=0; i < resultSize; i++) { result[i] = base + timestamps[tsIdx+i]; } return result; } }
public double[] getRawSnapshots() { int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; return series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); }
public double[] getRawSnapshots() { int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize=(endIdx-startIdx) + 1; return series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); }