@InterfaceAudience.LimitedPrivate(value="Replication") public class MetricsSource extends Object
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, if there are multiple groups, return the latest one
|
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(String walGroupId)
Convenience method to use the last given timestamp to refresh the age of the last edit.
|
void |
setAgeOfLastShippedOp(long timestamp,
String walGroup)
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, String walGroup)
timestamp
- write time of the editwalGroup
- which group we are settingpublic void refreshAgeOfLastShippedOp(String walGroupId)
walGroupId
- id of the group to updatepublic 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()
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.