Created
January 1, 2014 15:21
-
-
Save stepancheg/8208783 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.rrd4j.core.jrrd.ConsolidationFunctionType; | |
import org.rrd4j.core.jrrd.DataChunk; | |
import org.rrd4j.core.jrrd.RRDatabase; | |
import java.util.Calendar; | |
import java.util.GregorianCalendar; | |
/** | |
* @author Stepan Koltsov | |
*/ | |
public class Perftest { | |
public static void main(String[] args) throws Exception { | |
long start = System.currentTimeMillis(); | |
long end; | |
do { | |
long iterationStart = System.currentTimeMillis(); | |
iteration(); | |
end = System.currentTimeMillis(); | |
long d = end - iterationStart; | |
System.out.println(d + "ms per iteration"); | |
} while (end - start < 20000); | |
} | |
private static void iteration() throws Exception { | |
RRDatabase rrd = new RRDatabase("0.rrd"); | |
Calendar endCal = new GregorianCalendar(2013, 12, 31); | |
Calendar startCal = new GregorianCalendar(2013, 10, 31); | |
DataChunk data = rrd.getData(ConsolidationFunctionType.AVERAGE, startCal.getTimeInMillis() / 1000, endCal.getTimeInMillis() / 1000, 1L); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment