timeSeries.addTimeStamp(millisSinceLastSample); for (int i=0; i < resourceInstTable.length; i++) { ResourceInst inst = resourceInstTable[i];
public void dump(PrintWriter stream) { stream.print("archive=" + archiveName); if (info != null) { info.dump(stream); } for (int i=0; i < resourceTypeTable.length; i++) { if (resourceTypeTable[i] != null) { resourceTypeTable[i].dump(stream); } } stream.print("time="); timeSeries.dump(stream); for (int i=0; i < resourceInstTable.length; i++) { if (resourceInstTable[i] != null) { resourceInstTable[i].dump(stream); } } }
this.resourceInstTable = new ResourceInst[1024]; this.resourceTypeTable = new ResourceType[256]; timeSeries.setBase(startTimeStamp); if (dump) { info.dump(new PrintWriter(System.out));
timeSeries.addTimeStamp(millisSinceLastSample); for (int i=0; i < resourceInstTable.length; i++) { ResourceInst inst = resourceInstTable[i];
this.timeSeries.shrink();
this.timeSeries.shrink();
this.resourceInstTable = new ResourceInst[1024]; this.resourceTypeTable = new ResourceType[256]; timeSeries.setBase(startTimeStamp); if (dump) { info.dump(new PrintWriter(System.out));
public void dump(PrintWriter stream) { stream.print("archive=" + archiveName); if (info != null) { info.dump(stream); } for (int i=0; i < resourceTypeTable.length; i++) { if (resourceTypeTable[i] != null) { resourceTypeTable[i].dump(stream); } } stream.print("time="); timeSeries.dump(stream); for (int i=0; i < resourceInstTable.length; i++) { if (resourceInstTable[i] != null) { resourceInstTable[i].dump(stream); } } }
protected long[] getAllRawTimeStamps() { return archive.getTimeStamps().getRawTimeStamps(); } protected long getTimeBase() {
protected long getTimeBase() { return archive.getTimeStamps().getBase(); } /**
protected long[] getAllRawTimeStamps() { return archive.getTimeStamps().getRawTimeStamps(); } protected long getTimeBase() {
/** * Returns an array of time stamp values the first of which * has the specified index. * Each returned time stamp is the number of millis since * midnight, Jan 1, 1970 UTC. */ double[] getTimeValuesSinceIdx(int idx) { int resultSize = this.count - idx; double[] result = new double[resultSize]; for (int i=0; i < resultSize; i++) { result[i] = getMilliTimeStamp(idx+i); } return result; } }
/** * Returns an array of time stamp values the first of which * has the specified index. * Each returned time stamp is the number of millis since * midnight, Jan 1, 1970 UTC. */ double[] getTimeValuesSinceIdx(int idx) { int resultSize = this.count - idx; double[] result = new double[resultSize]; for (int i=0; i < resultSize; i++) { result[i] = getMilliTimeStamp(idx+i); } return result; } }
protected void makeInactive() { this.active = false; lastTSidx = archive.getTimeStamps().getSize() - 1; close(); // this frees up unused memory now that no more samples } /**
/** * Returns the number of times this resource instance has been sampled. */ public int getSampleCount() { if (active) { return archive.getTimeStamps().getSize() - firstTSidx; } else { return (lastTSidx+1) - firstTSidx; } }
/** * Returns the number of times this resource instance has been sampled. */ public int getSampleCount() { if (active) { return archive.getTimeStamps().getSize() - firstTSidx; } else { return (lastTSidx+1) - firstTSidx; } }
/** * Returns an array of doubles containing the timestamps at which * this instances samples where taken. Each of these timestamps * is the difference, measured in milliseconds, between the sample * time and midnight, January 1, 1970 UTC. * Although these values are double they can safely be converted * to <code>long</code> with no loss of information. */ public double[] getSnapshotTimesMillis() { return archive.getTimeStamps().getTimeValuesSinceIdx(firstTSidx); } /**
/** * Returns the difference, measured in milliseconds, between the time * of the instance's first sample and midnight, January 1, 1970 UTC. */ public long getFirstTimeMillis() { return archive.getTimeStamps().getMilliTimeStamp(firstTSidx); } /**
/** * Returns the difference, measured in milliseconds, between the time * of the instance's first sample and midnight, January 1, 1970 UTC. */ public long getFirstTimeMillis() { return archive.getTimeStamps().getMilliTimeStamp(firstTSidx); } /**
protected void addTimeStamp() { if (this.loaded) { if (firstTSidx == -1) { firstTSidx = archive.getTimeStamps().getSize() - 1; } for (int i=0; i < values.length; i++) { if (values[i] != null) { values[i].addSample(); } } } }