public void testUpdateThroughput() throws RepositoryException, IOException {
  final ValueFactory vf=om.getValueFactory();
  final int transCounter=om.beginNativeTransaction();
  final URI name=vf.createURI("attr:/test#name");
  final URI ni=vf.createURI("attr:/test#ni");
  final URI age=vf.createURI("attr:/test#age");
  final URI mob=vf.createURI("attr:/test#mobile");
  final URI gender=vf.createURI("attr:/test#mail");
  try {
    for (int i=0; i < 10000; i++) {
      final IGPO tst=om.createGPO();
      tst.setValue(name,vf.createLiteral("Test" + i));
    }
    final long start=System.currentTimeMillis();
    final int creates=50000;
    for (int i=0; i < creates; i++) {
      final IGPO tst=om.createGPO();
      tst.setValue(name,vf.createLiteral("Name" + i));
      tst.setValue(ni,vf.createLiteral("NI" + i));
      tst.setValue(age,vf.createLiteral(i));
      tst.setValue(mob,vf.createLiteral("0123-" + i));
      tst.setValue(gender,vf.createLiteral(1 % 3 == 0));
    }
    om.commitNativeTransaction(transCounter);
    final long duration=(System.currentTimeMillis() - start);
    final long objectsPS=creates * 1000 / duration;
    final long statementsPS=objectsPS * 5;
    if (log.isInfoEnabled()) {
      log.info("Creation rate of " + objectsPS + " objects per second");
      log.info("Creation rate of " + statementsPS + " statements per second");
    }
    assertTrue(statementsPS > 5000);
  }
 catch (  Throwable t) {
    om.rollbackNativeTransaction();
    throw new RuntimeException(t);
  }
}

public void testUpdateThroughput ( ) throws RepositoryException , IOException { final ValueFactory vf = om . getValueFactory ( ) ; final int transCounter = om . beginNativeTransaction ( ) ; final URI name = vf . createURI ( "attr:/test#name" ) ; final URI ni = vf . createURI ( "attr:/test#ni" ) ; final URI age = vf . createURI ( "attr:/test#age" ) ; final URI mob = vf . createURI ( "attr:/test#mobile" ) ; final URI gender = vf . createURI ( "attr:/test#mail" ) ; try { for ( int i = 0 ; i < 10000 ; i ++ ) { final IGPO tst = om . createGPO ( ) ; tst . setValue ( name , vf . createLiteral ( "Test" + i ) ) ; } final long start = System . currentTimeMillis ( ) ; final int creates = 50000 ; for ( int i = 0 ; i < creates ; i ++ ) { final IGPO tst = om . createGPO ( ) ; tst . setValue ( name , vf . createLiteral ( "Name" + i ) ) ; tst . setValue ( ni , vf . createLiteral ( "NI" + i ) ) ; tst . setValue ( age , vf . createLiteral ( i ) ) ; tst . setValue ( mob , vf . createLiteral ( "0123-" + i ) ) ; tst . setValue ( gender , vf . createLiteral ( 1 % 3 == 0 ) ) ; } om . commitNativeTransaction ( transCounter ) ; final long duration = ( System . currentTimeMillis ( ) - start ) ; final long objectsPS = creates * 1000 / duration ; final long statementsPS = objectsPS * 5 ; if ( log . isInfoEnabled ( ) ) { log . info ( "Creation rate of " + objectsPS + " objects per second" ) ; log . info ( "Creation rate of " + statementsPS + " statements per second" ) ; } assertTrue ( statementsPS > 5000 ) ; } catch ( Throwable t ) { om . rollbackNativeTransaction ( ) ; throw new RuntimeException ( t ) ; } }
throughput test for updates .
