Index: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsSource.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsSource.java (revision 1594033) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsSource.java (working copy) @@ -36,6 +36,7 @@ public static final String SOURCE_LOG_EDITS_READ = "source.logEditsRead"; public static final String SOURCE_LOG_EDITS_FILTERED = "source.logEditsFiltered"; public static final String SOURCE_SHIPPED_BATCHES = "source.shippedBatches"; + public static final String SOURCE_SHIPPED_KBS = "source.shippedKBs"; public static final String SOURCE_SHIPPED_OPS = "source.shippedOps"; public static final String SOURCE_LOG_READ_IN_BYTES = "source.logReadInBytes"; @@ -51,6 +52,7 @@ private String logEditsFilteredKey; private final String shippedBatchesKey; private final String shippedOpsKey; + private final String shippedKBsKey; private final String logReadInBytesKey; private MetricsReplicationSource rms; @@ -69,6 +71,7 @@ logEditsFilteredKey = "source." + id + ".logEditsFiltered"; shippedBatchesKey = "source." + this.id + ".shippedBatches"; shippedOpsKey = "source." + this.id + ".shippedOps"; + shippedKBsKey = "source." + this.id + ".shippedKBs"; logReadInBytesKey = "source." + this.id + ".logReadInBytes"; rms = CompatibilitySingletonFactory.getInstance(MetricsReplicationSource.class); } @@ -141,11 +144,13 @@ * * @param batchSize the size of the batch that was shipped to sinks. */ - public void shipBatch(long batchSize) { + public void shipBatch(long batchSize, int sizeInKB) { rms.incCounters(shippedBatchesKey, 1); rms.incCounters(SOURCE_SHIPPED_BATCHES, 1); rms.incCounters(shippedOpsKey, batchSize); rms.incCounters(SOURCE_SHIPPED_OPS, batchSize); + rms.incCounters(shippedKBsKey, sizeInKB); + rms.incCounters(SOURCE_SHIPPED_KBS, sizeInKB); } /** increase the byte number read by source from log file */ Index: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java =================================================================== --- hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (revision 1594033) +++ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (working copy) @@ -738,7 +738,7 @@ } this.totalReplicatedEdits += entries.size(); this.totalReplicatedOperations += currentNbOperations; - this.metrics.shipBatch(this.currentNbOperations); + this.metrics.shipBatch(this.currentNbOperations, this.currentSize/1024); this.metrics.setAgeOfLastShippedOp(entries.get(entries.size()-1).getKey().getWriteTime()); if (LOG.isTraceEnabled()) { LOG.trace("Replicated " + this.totalReplicatedEdits + " entries in total, or "