public final class DefaultMeter extends Object implements Meter, MeterEntry
Modifier and Type | Class and Description |
---|---|
static class |
DefaultMeter.Builder |
Meter.Unit
Modifier and Type | Method and Description |
---|---|
ApplicationId |
appId()
The id of the application which created this meter.
|
Collection<Band> |
bands()
The collection of bands to apply on the dataplane.
|
static DefaultMeter.Builder |
builder() |
long |
bytesSeen()
Number of bytes processed by this meter.
|
DeviceId |
deviceId()
The target device for this meter.
|
boolean |
equals(Object o) |
int |
hashCode() |
MeterId |
id()
This meters id.
|
boolean |
isBurst()
Signals whether this meter applies to bursts only.
|
long |
life()
The lifetime in seconds of this meter.
|
MeterCellId |
meterCellId()
Returns the meter cell identifier of this meter.
|
long |
packetsSeen()
Number of packets processed by this meter.
|
long |
referenceCount()
The number of flows pointing to this meter.
|
void |
setLife(long life)
Set the amount of time the meter has existed in seconds.
|
void |
setProcessedBytes(long bytes)
Updates the number of bytes seen by the meter.
|
void |
setProcessedPackets(long packets)
Updates the number of packets seen by this meter.
|
void |
setReferenceCount(long count)
Sets the number of flows which are using this meter.
|
void |
setState(MeterState state)
Updates the state of this meter.
|
MeterState |
state()
Fetches the state of this meter.
|
String |
toString() |
Meter.Unit |
unit()
The unit used within this meter.
|
public DeviceId deviceId()
Meter
public MeterCellId meterCellId()
Meter
meterCellId
in interface Meter
public ApplicationId appId()
Meter
public Meter.Unit unit()
Meter
public boolean isBurst()
Meter
public Collection<Band> bands()
Meter
public MeterState state()
Meter
public long life()
Meter
public long referenceCount()
Meter
referenceCount
in interface Meter
public long packetsSeen()
Meter
packetsSeen
in interface Meter
public long bytesSeen()
Meter
public static DefaultMeter.Builder builder()
public void setState(MeterState state)
MeterEntry
setState
in interface MeterEntry
state
- a meter statepublic void setLife(long life)
MeterEntry
setLife
in interface MeterEntry
life
- number of secondspublic void setReferenceCount(long count)
MeterEntry
setReferenceCount
in interface MeterEntry
count
- a reference count.public void setProcessedPackets(long packets)
MeterEntry
setProcessedPackets
in interface MeterEntry
packets
- a packet count.public void setProcessedBytes(long bytes)
MeterEntry
setProcessedBytes
in interface MeterEntry
bytes
- a byte counter.