public class ExternalGauge extends Object implements Gauge
ExternalValue value
This object is read only and the mutating methods throw UnsupportedOperationException if called. The
reasoning for this is that it cant know how to change its delegate ExternalValue.
| Constructor and Description |
|---|
ExternalGauge(String name,
ExternalValue externalValue)
Constructs a
Gauge that reads its value from the ExternalValue
provided. |
| Modifier and Type | Method and Description |
|---|---|
long |
addAndGet(long delta)
Adds the delta value to the Gauge and returns the new value.
|
int |
compareTo(Instrument that) |
long |
decrementAndGet()
Decrements one from the Gauge and returns the new value
|
String |
getName() |
long |
getValue() |
long |
incrementAndGet()
Adds one to the Gauge and returns the new value
|
String |
toString() |
public ExternalGauge(String name, ExternalValue externalValue)
Gauge that reads its value from the ExternalValue
provided.name - the name of the GaugeexternalValue - - the ExternalInstrument to read its value from.IllegalArgumentException - if the externalValue is nullpublic String getName()
getName in interface Instrumentpublic long incrementAndGet()
GaugeincrementAndGet in interface Gaugepublic long decrementAndGet()
GaugedecrementAndGet in interface Gaugepublic long addAndGet(long delta)
Gaugepublic long getValue()
getValue in interface Instrumentpublic int compareTo(Instrument that)
compareTo in interface Comparable<Instrument>Copyright © 2016 Atlassian. All rights reserved.