@InterfaceAudience.LimitedPrivate(value="Replication") public class MetricsSource extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
MetricsSource(String id)
Constructor used to register the metrics
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all metrics about this Source.
|
Long |
getAgeOfLastShippedOp()
Get AgeOfLastShippedOp
|
String |
getPeerID()
Get the slave peer ID
|
int |
getSizeOfLogQueue()
Get the sizeOfLogQueue
|
long |
getTimeStampOfLastShippedOp()
Get the timeStampsOfLastShippedOp
|
void |
incrBytesSkippedInUncleanlyClosedWALs(long bytes) |
void |
incrCompletedRecoveryQueue() |
void |
incrCompletedWAL() |
void |
incrLogEditsFiltered()
The number of log edits filtered out.
|
void |
incrLogEditsFiltered(long delta)
Add on the number of log edits filtered
|
void |
incrLogEditsRead()
Increment the number of log edits read by one.
|
void |
incrLogReadInBytes(long readInBytes)
increase the byte number read by source from log file
|
void |
incrRepeatedFileBytes(long bytes) |
void |
incrRestartedWALReading() |
void |
incrUncleanlyClosedWALs() |
void |
incrUnknownFileLengthForClosedWAL() |
void |
refreshAgeOfLastShippedOp()
Convenience method to use the last given timestamp to refresh the age of the last edit.
|
void |
setAgeOfLastShippedOp(long timestamp)
Set the age of the last edit that was shipped
|
void |
setSizeOfLogQueue(int size)
Set the size of the log queue
|
void |
shipBatch(long batchSize,
int sizeInKB)
Convience method to apply changes to metrics do to shipping a batch of logs.
|
public MetricsSource(String id)
id
- Name of the source this class is monitoringpublic void setAgeOfLastShippedOp(long timestamp)
timestamp
- write time of the editpublic void refreshAgeOfLastShippedOp()
public void setSizeOfLogQueue(int size)
size
- the size.public void incrLogEditsRead()
public void incrLogEditsFiltered(long delta)
delta
- the number filtered.public void incrLogEditsFiltered()
public void shipBatch(long batchSize, int sizeInKB)
batchSize
- the size of the batch that was shipped to sinks.public void incrLogReadInBytes(long readInBytes)
public void clear()
public Long getAgeOfLastShippedOp()
public int getSizeOfLogQueue()
public long getTimeStampOfLastShippedOp()
public String getPeerID()
public void incrUnknownFileLengthForClosedWAL()
public void incrUncleanlyClosedWALs()
public void incrBytesSkippedInUncleanlyClosedWALs(long bytes)
public void incrRestartedWALReading()
public void incrRepeatedFileBytes(long bytes)
public void incrCompletedWAL()
public void incrCompletedRecoveryQueue()
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.