Package org.apache.solr.util.stats
Class MetricUtils
java.lang.Object
org.apache.solr.util.stats.MetricUtils
Metrics specific utility functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String[]These are well-known implementations ofOperatingSystemMXBean.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMetrics(org.apache.solr.common.util.NamedList<Object> lst, com.codahale.metrics.Timer timer) Adds metrics from a Timer to a NamedList, using well-known back-compat names.static doublebytesToMegabytes(long bytes) Converts bytes to megabytes.static doublensToMs(double ns) Converts a double representing nanoseconds to a double representing milliseconds.
-
Field Details
-
VALUE
- See Also:
-
OS_MXBEAN_CLASSES
These are well-known implementations ofOperatingSystemMXBean. Some of them provide additional useful properties beyond those declared by the interface.
-
-
Constructor Details
-
MetricUtils
public MetricUtils()
-
-
Method Details
-
addMetrics
public static void addMetrics(org.apache.solr.common.util.NamedList<Object> lst, com.codahale.metrics.Timer timer) Adds metrics from a Timer to a NamedList, using well-known back-compat names.- Parameters:
lst- The NamedList to add the metrics data totimer- The Timer to extract the metrics from
-
nsToMs
public static double nsToMs(double ns) Converts a double representing nanoseconds to a double representing milliseconds.- Parameters:
ns- the amount of time in nanoseconds- Returns:
- the amount of time in milliseconds
-
bytesToMegabytes
public static double bytesToMegabytes(long bytes) Converts bytes to megabytes.- Parameters:
bytes- the number of bytes- Returns:
- the number of megabytes
-