Package de.scoopgmbh.copper.monitoring

Examples of de.scoopgmbh.copper.monitoring.StmtStatistic


    this.runtimeStatisticsCollector = runtimeStatisticsCollector;
  }


  private void initStats() {
    dequeueStmtStatistic = new StmtStatistic("DBStorage.dequeue.fullquery",runtimeStatisticsCollector);
    queueDeleteStmtStatistic = new StmtStatistic("DBStorage.queue.delete",runtimeStatisticsCollector);
    enqueueUpdateStateStmtStatistic = new StmtStatistic("DBStorage.enqueue.updateState",runtimeStatisticsCollector);
    insertStmtStatistic = new StmtStatistic("DBStorage.insert",runtimeStatisticsCollector);
    deleteStaleResponsesStmtStatistic = new StmtStatistic("DBStorage.deleteStaleResponses",runtimeStatisticsCollector);
  }
View Full Code Here


  public void startup() {
    if (engineIdProvider == null || engineIdProvider.getEngineId() == null) throw new NullPointerException("EngineId is NULL! Change your "+getClass().getSimpleName()+" configuration.");
  }

  private void initStmtStats() {
    dequeueAllStmtStatistic = new StmtStatistic("DBStorage.dequeue.fullquery.all", runtimeStatisticsCollector);
    dequeueQueryBPsStmtStatistic = new StmtStatistic("DBStorage.dequeue.fullquery.queryBPs", runtimeStatisticsCollector);
    dequeueQueryResponsesStmtStatistic = new StmtStatistic("DBStorage.dequeue.fullquery.queryResponses", runtimeStatisticsCollector);
    dequeueMarkStmtStatistic = new StmtStatistic("DBStorage.dequeue.mark", runtimeStatisticsCollector);
    enqueueUpdateStateStmtStatistic = new StmtStatistic("DBStorage.enqueue.updateState", runtimeStatisticsCollector);
    insertStmtStatistic = new StmtStatistic("DBStorage.insert", runtimeStatisticsCollector);
    deleteStaleResponsesStmtStatistic = new StmtStatistic("DBStorage.deleteStaleResponses", runtimeStatisticsCollector);
    dequeueWait4RespLdrStmtStatistic = new StmtStatistic("DBStorage.wait4resLoaderStmtStatistic", runtimeStatisticsCollector);

  }
View Full Code Here

    return sb.toString();
  }

  private static void test(final DataSource dataSource, final IdFactory idFactory, final byte[] data, final byte[] response, final String data_s, final String response_s, final PrintStream ps) throws InterruptedException, Exception {
    Thread.sleep(30000);
    final StmtStatistic a = new StmtStatistic("INSERT INTO BUSI", new NullRuntimeStatisticsCollector());
    final StmtStatistic b = new StmtStatistic("INSERT INTO WAIT", new NullRuntimeStatisticsCollector());
    final StmtStatistic c = new StmtStatistic("INSERT INTO RESP", new NullRuntimeStatisticsCollector());
    for (int i=0; i<5; i++) {
      final List<String> ids = new ArrayList<String>(100000);
      final List<String> cids = new ArrayList<String>(100000);
      new RetryingTransaction<Void>(dataSource) {
        @Override
        protected Void execute() throws Exception {
          PreparedStatement stmtBP = getConnection().prepareStatement("INSERT INTO COP_WORKFLOW_INSTANCE (ID,STATE,PRIORITY,LAST_MOD_TS,PPOOL_ID,DATA_S) VALUES (?,2,5,SYSTIMESTAMP,'P#DEFAULT',?)");
          for (int k=0; k<100; k++) {
            for (int i=0; i<200; i++) {
              String id = idFactory.createId();
              ids.add(id);
              stmtBP.setString(1, id);
              //stmtBP.setBytes(2, data);
              stmtBP.setString(2, data_s);
              stmtBP.addBatch();
            }
            a.start();
            stmtBP.executeBatch();
            getConnection().commit();
            a.stop(200);
            stmtBP.clearBatch();
          }

          PreparedStatement stmtWAIT = getConnection().prepareStatement("INSERT INTO COP_WAIT (CORRELATION_ID, WORKFLOW_INSTANCE_ID, CS_WAITMODE, COUNT) VALUES (?,?,0,1)");
          for (int k=0; k<100; k++) {
            for (int i=0; i<200; i++) {
              String bp_id = ids.remove(ids.size()-1);
              String c_id = idFactory.createId();
              cids.add(c_id);
              stmtWAIT.setString(1, c_id);
              stmtWAIT.setString(2, bp_id);
              stmtWAIT.addBatch();
            }
            b.start();
            stmtWAIT.executeBatch();
            getConnection().commit();
            b.stop(200);
            stmtWAIT.clearBatch();
          }

          PreparedStatement stmtRES = getConnection().prepareStatement("INSERT INTO COP_RESPONSE (CORRELATION_ID, RESPONSE_TS, RESPONSE_S) VALUES (?,SYSTIMESTAMP,?)");
          for (int k=0; k<25; k++) {
            for (int i=0; i<200; i++) {
              String c_id = cids.remove(cids.size()-1);
              stmtRES.setString(1, c_id);
              //stmtRES.setBytes(2, response);
              stmtRES.setString(2, response_s);
              stmtRES.addBatch();
            }
            c.start();
            stmtRES.executeBatch();
            getConnection().commit();
            c.stop(200);
            stmtRES.clearBatch();
          }
         
          return null;
        }
View Full Code Here

TOP

Related Classes of de.scoopgmbh.copper.monitoring.StmtStatistic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.