From: Sasa M. <sa...@us...> - 2004-12-08 14:02:45
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23351/org/jrobin/core Modified Files: RrdDb.java Log Message: Implemented 95th percentile for datasource values (see get95Percentile method in the DataAnalyzer class). Minor changes in the core package. Index: RrdDb.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdDb.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** RrdDb.java 19 Nov 2004 12:00:01 -0000 1.34 --- RrdDb.java 8 Dec 2004 14:02:36 -0000 1.35 *************** *** 556,572 **** } backend.beforeUpdate(); ! long newTime = sample.getTime(); ! long lastTime = header.getLastUpdateTime(); ! if(lastTime >= newTime) { ! throw new RrdException("Bad sample timestamp " + newTime + ! ". Last update time was " + lastTime + ", at least one second step is required"); } ! double[] newValues = sample.getValues(); ! for(int i = 0; i < datasources.length; i++) { ! double newValue = newValues[i]; ! datasources[i].process(newTime, newValue); } - header.setLastUpdateTime(newTime); - backend.afterUpdate(); } --- 556,576 ---- } backend.beforeUpdate(); ! try { ! long newTime = sample.getTime(); ! long lastTime = header.getLastUpdateTime(); ! if(lastTime >= newTime) { ! throw new RrdException("Bad sample timestamp " + newTime + ! ". Last update time was " + lastTime + ", at least one second step is required"); ! } ! double[] newValues = sample.getValues(); ! for(int i = 0; i < datasources.length; i++) { ! double newValue = newValues[i]; ! datasources[i].process(newTime, newValue); ! } ! header.setLastUpdateTime(newTime); } ! finally { ! backend.afterUpdate(); } } *************** *** 587,594 **** } backend.beforeFetch(); ! Archive archive = findMatchingArchive(request); ! FetchData fetchData = archive.fetchData(request); ! backend.afterFetch(); ! return fetchData; } --- 591,602 ---- } backend.beforeFetch(); ! try { ! Archive archive = findMatchingArchive(request); ! FetchData fetchData = archive.fetchData(request); ! return fetchData; ! } ! finally { ! backend.afterFetch(); ! } } |