@Override public String toString() { return Strings.duration(currentTimeInMillis); } }
@Override protected void pollComplete(List<SourceRecord> batch) { // Record a bit about this batch ... int batchSize = batch.size(); recordCounter += batchSize; totalRecordCounter.addAndGet(batchSize); if (batchSize > 0) { SourceRecord lastRecord = batch.get(batchSize - 1); lastOffset = lastRecord.sourceOffset(); if (pollOutputDelay.hasElapsed()) { // We want to record the status ... long millisSinceLastOutput = clock.currentTimeInMillis() - previousOutputMillis; try { context.temporaryLoggingContext("binlog", () -> { logger.info("{} records sent during previous {}, last recorded offset: {}", recordCounter, Strings.duration(millisSinceLastOutput), lastOffset); }); } finally { recordCounter = 0; previousOutputMillis += millisSinceLastOutput; } } } }
private void consumeRecords(long recordsCount) { int totalConsumedRecords = 0; long start = System.currentTimeMillis(); while (totalConsumedRecords < recordsCount) { int consumed = super.consumeAvailableRecords(record -> {}); if (consumed > 0) { totalConsumedRecords += consumed; System.out.println("consumed " + totalConsumedRecords + " records"); } } System.out.println("total duration to ingest '" + recordsCount + "' records: " + Strings.duration(System.currentTimeMillis() - start)); }
numDocumentsCopied.addAndGet(numDocs); long duration = clock.currentTimeInMillis() - start; logger.info("Completing initial sync of {} documents from '{}' in {}", numDocs, id, Strings.duration(duration)); int remaining = collections.size() - numCollectionsCopied.get(); logger.info("Initial sync aborted after {} with {} of {} collections incomplete", Strings.duration(syncDuration), remaining, collections.size()); return false; collections.size(), numDocumentsCopied.get(), Strings.duration(syncDuration)); return true;
rs -> readTable(tableId, rs, consumer, rowsCounter)); logger.info("\t finished exporting '{}' records for '{}'; total duration '{}'", rowsCounter.get(), tableId, Strings.duration(clock().currentTimeInMillis() - exportStart)); rowsCounter.set(0); } catch (SQLException e) { logger.info("Snapshot completed in '{}'", Strings.duration(clock().currentTimeInMillis() - snapshotStart)); Heartbeat .create( rollbackTransaction(jdbcConnection); logger.warn("Snapshot aborted after '{}'", Strings.duration(clock().currentTimeInMillis() - snapshotStart));
long stop = clock.currentTimeInMillis(); LOGGER.info("\t Exported {} records for table '{}' after {}", rows, table.id(), Strings.duration(stop - exportStart)); snapshotProgressListener.rowsScanned(table.id(), rows); logTimer = getTableScanLogTimer(); table.id(), Strings.duration(clock.currentTimeInMillis() - exportStart)); snapshotProgressListener.tableSnapshotCompleted(table.id(), rows);
private void consumeRecords(long recordsCount) { int totalConsumedRecords = 0; long start = System.currentTimeMillis(); while (totalConsumedRecords < recordsCount) { int consumed = super.consumeAvailableRecords(record -> {}); if (consumed > 0) { totalConsumedRecords += consumed; System.out.println("consumed " + totalConsumedRecords + " records"); } } System.out.println("total duration to ingest '" + recordsCount + "' records: " + Strings.duration(System.currentTimeMillis() - start)); }
long stop = clock.currentTimeInMillis(); LOGGER.info("\t Exported {} records for table '{}' after {}", rows, table.id(), Strings.duration(stop - exportStart)); snapshotProgressListener.rowsScanned(table.id(), rows); logTimer = getTableScanLogTimer(); table.id(), Strings.duration(clock.currentTimeInMillis() - exportStart)); snapshotProgressListener.tableSnapshotCompleted(table.id(), rows);
rs -> readTable(tableId, rs, consumer, rowsCounter)); logger.info("\t finished exporting '{}' records for '{}'; total duration '{}'", rowsCounter.get(), tableId, Strings.duration(clock().currentTimeInMillis() - exportStart)); rowsCounter.set(0); } catch (SQLException e) { logger.info("Snapshot completed in '{}'", Strings.duration(clock().currentTimeInMillis() - snapshotStart)); Heartbeat .create( rollbackTransaction(jdbcConnection); logger.warn("Snapshot aborted after '{}'", Strings.duration(clock().currentTimeInMillis() - snapshotStart));