Class NoopGauge
java.lang.Object
eu.rarogsoftware.rarog.platform.core.metrics.noop.NoopGauge
- All Implemented Interfaces:
BasicMetric<Gauge>,Gauge
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.rarogsoftware.rarog.platform.api.metrics.Gauge
Gauge.Timer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecrease(double amount) Decrement gauge by given amount.voidincrease(double amount) Increment gauge by given amount.Returns child with the given labels.doublemeasureExecutionTime(Runnable timeable) Executes runnable code and observes a duration of how long it took to run.<T> TmeasureExecutionTime(Callable<T> timeable) Executes runnable code and observes a duration of how long it took to run.voidset(double value) Set gauge to given amount.Start a timer to track a duration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.rarogsoftware.rarog.platform.api.metrics.BasicMetric
labels
-
Constructor Details
-
NoopGauge
NoopGauge()
-
-
Method Details
-
increase
public void increase(double amount) Description copied from interface:GaugeIncrement gauge by given amount. -
decrease
public void decrease(double amount) Description copied from interface:GaugeDecrement gauge by given amount. -
set
public void set(double value) Description copied from interface:GaugeSet gauge to given amount. -
startTimer
Description copied from interface:GaugeStart a timer to track a duration.Call
Gauge.Timer.stop()at the end of what you want to measure duration of.Gauge.TimerisCloseableto you can use it in try with resources to auto callGauge.Timer.stop()- Specified by:
startTimerin interfaceGauge- Returns:
- timer object
-
measureExecutionTime
Description copied from interface:GaugeExecutes runnable code and observes a duration of how long it took to run.- Specified by:
measureExecutionTimein interfaceGauge- Parameters:
timeable- Code that is being timed- Returns:
- Measured duration in seconds for timeable to complete.
-
measureExecutionTime
Description copied from interface:GaugeExecutes runnable code and observes a duration of how long it took to run.- Specified by:
measureExecutionTimein interfaceGauge- Parameters:
timeable- Code that is being timed- Returns:
- result of timeable function
- Throws:
Exception- exception thrown by timeable function
-
labels
Description copied from interface:BasicMetricReturns child with the given labels.Must be passed the same number of labels are were passed to
BaseMetricSettings.labels(String...).- Specified by:
labelsin interfaceBasicMetric<Gauge>- Parameters:
labels- labels (dimensions) of metric to log
-