Class CollectHelper
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.utils.CollectHelper
The
CollectHelper class provides utility methods for extracting metric values and collect times from
Monitor instances. It includes methods for working with both NumberMetric and StateSetMetric.
The class is designed to have a private no-argument constructor to prevent instantiation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DoublegetDoubleValue(Number number) static DoublegetNumberMetricCollectTime(Monitor monitor, String metricRateName, boolean previous) Get theNumberMetriccollect timestatic DoublegetNumberMetricValue(Monitor monitor, String metricName, boolean previous) Get theNumberMetricvaluestatic StringgetStateSetMetricValue(Monitor monitor, String metricName, boolean previous) Get theStateSetMetricvalue.static DoublegetUpdatedNumberMetricValue(Monitor monitor, String metricName) Get the updatedNumberMetricvalue
-
Constructor Details
-
CollectHelper
public CollectHelper()
-
-
Method Details
-
getNumberMetricValue
Get theNumberMetricvalue- Parameters:
monitor- TheMonitorinstance we wish to extract theNumberMetricvaluemetricName- The name of theNumberMetricinstanceprevious- Indicate whether we should return thevalueor thepreviousValue.- Returns:
- a
Doublevalue
-
getStateSetMetricValue
Get theStateSetMetricvalue.- Parameters:
monitor- TheMonitorinstance from which to extract theStateSetMetricvalue.metricName- The name of theStateSetMetricinstance.previous- Indicate whether to return thevalueor thepreviousValue.- Returns:
- The
Stringvalue.
-
getNumberMetricCollectTime
public static Double getNumberMetricCollectTime(Monitor monitor, String metricRateName, boolean previous) Get theNumberMetriccollect time- Parameters:
monitor- TheMonitorinstance we wish to extract theNumberMetriccollect timemetricRateName- The name of theNumberMetricinstanceprevious- Indicate whether we should return thecollectTimeor thepreviousCollectTime.- Returns:
- a
Doublevalue
-
getDoubleValue
-
getUpdatedNumberMetricValue
Get the updatedNumberMetricvalue- Parameters:
monitor- TheMonitorinstance we wish to extract theNumberMetricvaluemetricName- The name of theNumberMetricinstance- Returns:
- a
Doublevalue
-