Search in sources :

Example 1 with RrdNioByteBufferBackendFactory

use of org.jrobin.core.RrdNioByteBufferBackendFactory in project opennms by OpenNMS.

the class JRobinConverterTest method testBackends.

@Test
public void testBackends() throws Exception {
    final RrdBackendFactory[] factories = new RrdBackendFactory[] { new RrdFileBackendFactory(), new RrdNioBackendFactory(), new RrdNioByteBufferBackendFactory(), new RrdJRobin14FileBackendFactory(LockMode.EXCEPTION_IF_LOCKED), new RrdJRobin14FileBackendFactory(LockMode.WAIT_IF_LOCKED), new RrdJRobin14FileBackendFactory(LockMode.NO_LOCKS) };
    for (final RrdBackendFactory factory : factories) {
        // LogUtils.infof(this, "starting with backend factory %s", factory);
        m_sineFull.delete();
        m_sineSourceA.delete();
        long factoryStart = System.nanoTime();
        createMockSineRrds(factory);
        for (int i = 0; i < 10; i++) {
            final File newFile = m_converter.createTempRrd(m_sineFull);
            try {
                m_converter.consolidateRrdFile(m_sineSourceA, newFile);
            } finally {
                newFile.delete();
            }
        }
        long nanos = System.nanoTime() - factoryStart;
        LogUtils.infof(this, "factory %s took %f seconds", factory, (nanos / 1000000000D));
    }
}
Also used : RrdBackendFactory(org.jrobin.core.RrdBackendFactory) RrdNioBackendFactory(org.jrobin.core.RrdNioBackendFactory) RrdNioByteBufferBackendFactory(org.jrobin.core.RrdNioByteBufferBackendFactory) RrdFileBackendFactory(org.jrobin.core.RrdFileBackendFactory) File(java.io.File) RrdJRobin14FileBackendFactory(org.jrobin.core.RrdJRobin14FileBackendFactory) Test(org.junit.Test)

Aggregations

File (java.io.File)1 RrdBackendFactory (org.jrobin.core.RrdBackendFactory)1 RrdFileBackendFactory (org.jrobin.core.RrdFileBackendFactory)1 RrdJRobin14FileBackendFactory (org.jrobin.core.RrdJRobin14FileBackendFactory)1 RrdNioBackendFactory (org.jrobin.core.RrdNioBackendFactory)1 RrdNioByteBufferBackendFactory (org.jrobin.core.RrdNioByteBufferBackendFactory)1 Test (org.junit.Test)1