Class MetricUtils

java.lang.Object
org.apache.solr.util.stats.MetricUtils

public class MetricUtils extends Object
Metrics specific utility functions.
  • Field Details

    • VALUE

      public static final String VALUE
      See Also:
    • OS_MXBEAN_CLASSES

      public static String[] OS_MXBEAN_CLASSES
      These are well-known implementations of OperatingSystemMXBean. 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 to
      timer - 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