コード例 #1
0
ファイル: MyTPCC.java プロジェクト: taharafiq/voltdb
    @Override
    public void clientCallback(ClientResponse clientResponse) {
      boolean status = clientResponse.getStatus() == ClientResponse.SUCCESS;
      assert this.cbRollback || status;
      procCounts[TPCCSimulation.Transaction.NEW_ORDER.ordinal()].incrementAndGet();

      counterLock.lock();
      try {
        totExecutions++;

        if (checkLatency) {
          long executionTime = clientResponse.getClientRoundtrip();

          totExecutionsLatency++;
          totExecutionMilliseconds += executionTime;

          if (executionTime < minExecutionMilliseconds) {
            minExecutionMilliseconds = executionTime;
          }

          if (executionTime > maxExecutionMilliseconds) {
            maxExecutionMilliseconds = executionTime;
          }

          // change latency to bucket
          int latencyBucket = (int) (executionTime / 25l);
          if (latencyBucket > 8) {
            latencyBucket = 8;
          }
          latencyCounter[latencyBucket]++;
        }
      } finally {
        counterLock.unlock();
      }
    }
コード例 #2
0
ファイル: BulkTPCCClient.java プロジェクト: Eonblast/voltdb
 @Override
 public void clientCallback(ClientResponse clientResponse) {
   assert this.cbRollback || (clientResponse.getResults() != null);
   m_counts[TPCCSimulation.Transaction.NEW_ORDER.ordinal()].incrementAndGet();
 }