From: Sasa M. <sa...@us...> - 2004-08-27 09:42:51
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24887/org/jrobin/core Modified Files: Robin.java RrdToolkit.java Log Message: Major RRDInspector changes: - archived values are editable - archived values can be plotted - multiple RRDs/plots can be open Index: Robin.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/Robin.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Robin.java 18 Aug 2004 08:02:17 -0000 1.13 --- Robin.java 27 Aug 2004 09:42:42 -0000 1.14 *************** *** 147,150 **** --- 147,161 ---- } + /** + * Sets the i-th value in the Robin archive. + * @param index index in the archive (the oldest value has zero index) + * @param value value to be stored + * @throws IOException Thrown in case of I/O specific error. + */ + public void setValue(int index, double value) throws IOException { + int arrayIndex = (pointer.get() + index) % rows; + values.set(arrayIndex, value); + } + double[] getValues(int index, int count) throws IOException { assert count <= rows: "Too many values requested: " + count + " rows=" + rows; Index: RrdToolkit.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdToolkit.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RrdToolkit.java 13 Jul 2004 09:39:09 -0000 1.10 --- RrdToolkit.java 27 Aug 2004 09:42:42 -0000 1.11 *************** *** 294,297 **** --- 294,313 ---- /** + * Sets datasource heartbeat to a new value. + * @param sourcePath Path to exisiting RRD file (will be updated) + * @param dsIndex Index of the datasource in the specified RRD file + * @param newHeartbeat New datasource heartbeat + * @throws RrdException Thrown in case of JRobin specific error + * @throws IOException Thrown in case of I/O error + */ + public void setDsHeartbeat(String sourcePath, int dsIndex, long newHeartbeat) + throws RrdException, IOException { + RrdDb rrd = new RrdDb(sourcePath); + Datasource ds = rrd.getDatasource(dsIndex); + ds.setHeartbeat(newHeartbeat); + rrd.close(); + } + + /** * Sets datasource min value to a new value * @param sourcePath Path to exisiting RRD file (will be updated) |