From: Sasa M. <sa...@us...> - 2005-01-18 13:05:36
|
Update of /cvsroot/jrobin/src/org/jrobin/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30851/org/jrobin/data Modified Files: DataProcessor.java Log Message: Added getter/setter for the desired archive step (fetch resolution) to be used while fetching data from RRD files. The method DataProcessor.setFetchRequestResolution() provides functionality necessary for the RrdGraphDef.setResolution() method. Index: DataProcessor.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/data/DataProcessor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DataProcessor.java 31 Dec 2004 08:45:17 -0000 1.8 --- DataProcessor.java 18 Jan 2005 13:05:25 -0000 1.9 *************** *** 76,79 **** --- 76,81 ---- // this will be adjusted later private long step = 0; + // resolution to be used for RRD fetch operation + private long fetchRequestResolution = 1; // the order is important, ordinary HashMap is unordered *************** *** 204,207 **** --- 206,234 ---- /** + * Returns desired RRD archive step (reslution) in seconds to be used while fetching data + * from RRD files. In other words, this value will used as the last parameter of + * {@link RrdDb#createFetchRequest(String, long, long, long) RrdDb.createFetchRequest()} method + * when this method is called internally by this DataProcessor. + * + * @return Desired archive step (fetch resolution) in seconds. + */ + public long getFetchRequestResolution() { + return fetchRequestResolution; + } + + /** + * Sets desired RRD archive step in seconds to be used internally while fetching data + * from RRD files. In other words, this value will used as the last parameter of + * {@link RrdDb#createFetchRequest(String, long, long, long) RrdDb.createFetchRequest()} method + * when this method is called internally by this DataProcessor. If this method is never called, fetch + * request resolution defaults to 1 (smallest possible archive step will be chosen automatically). + * + * @param fetchRequestResolution Desired archive step (fetch resoltuion) in seconds. + */ + public void setFetchRequestResolution(long fetchRequestResolution) { + this.fetchRequestResolution = fetchRequestResolution; + } + + /** * Returns ending timestamp. Basically, this value is equal to the ending timestamp * specified in the constructor. However, if the ending timestamps was zero, it *************** *** 675,679 **** try { rrd = getRrd(defSources[i]); ! FetchRequest req = rrd.createFetchRequest(defSources[i].getConsolFun(), tStart, tEndFixed); req.setFilter(dsNames); FetchData data = req.fetchData(); --- 702,707 ---- try { rrd = getRrd(defSources[i]); ! FetchRequest req = rrd.createFetchRequest(defSources[i].getConsolFun(), ! tStart, tEndFixed, fetchRequestResolution); req.setFilter(dsNames); FetchData data = req.fetchData(); *************** *** 845,849 **** // uncomment and run again ! //dp.setStep(7300); // datasource definitions --- 873,880 ---- // uncomment and run again ! //dp.setFetchRequestResolution(86400); ! ! // uncomment and run again ! //dp.setStep(86500); // datasource definitions |