for (int i = 0; i < stats.length; i++) { long v; switch (stats[i].getTypeCode()) { case BOOLEAN_CODE: v = dataIn.readByte(); default: throw new IOException(String.format("unexpected typeCode value %s", Byte.valueOf(stats[i].getTypeCode())));
while (statOffset != ILLEGAL_STAT_OFFSET) { long statDeltaBits; switch (stats[statOffset].getTypeCode()) { case BOOLEAN_CODE: statDeltaBits = dataIn.readByte(); default: throw new IOException(String.format("unexpected typeCode value %s", Byte.valueOf(stats[statOffset].getTypeCode())));
@Override 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; }
@Override public double[] getRawSnapshots() { int startIdx = getStartIdx(); int endIdx = getEndIdx(startIdx); int resultSize = (endIdx - startIdx) + 1; return series.getValuesEx(descriptor.getTypeCode(), startIdx, resultSize); }