@InterfaceAudience.LimitedPrivate(value="Replication") public class MetricsSource extends Object
Modifier and Type | Field and Description |
---|---|
static 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 |
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 |
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()