@InterfaceAudience.LimitedPrivate(value="Replication") public class MetricsSource extends Object
Modifier and Type | Field and Description |
---|---|
private MetricsReplicationSourceSource |
globalSourceSource |
private String |
id |
private int |
lastQueueSize |
private Map<String,Long> |
lastTimeStamps |
private static org.apache.commons.logging.Log |
LOG |
private MetricsReplicationSourceSource |
singleSourceSource |
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 |
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.
|
private void |
incrLogEditsRead(long delta)
Add on the the number of log edits read
|
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(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.
|
private static final org.apache.commons.logging.Log LOG
private int lastQueueSize
private String id
private final MetricsReplicationSourceSource singleSourceSource
private final MetricsReplicationSourceSource globalSourceSource
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.private void incrLogEditsRead(long delta)
delta
- the number of log edits read.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–2019 The Apache Software Foundation. All rights reserved.