Class Util


  • public abstract class Util
    extends Object
    Miscellaneous utility methods used by parsers and preprocessors.
    Author:
    vasily@wavefront.com.
    • Method Detail

      • parseTextualTimeExact

        public static long parseTextualTimeExact​(String interval,
                                                 long anchorTime,
                                                 TimeZone timeZone)
        Parse a natural language time interval expression (e.g. "now", "10 minutes ago", etc)
        Parameters:
        interval - time interval to parse
        anchorTime - anchor time in epoch millis
        timeZone - time zone
        Returns:
        epoch millis
      • expandPlaceholders

        @Deprecated
        public static String expandPlaceholders​(String input,
                                                ReportPoint reportPoint)
        Deprecated.
        Substitute {{...}} placeholders with corresponding components of the point {{metricName}} {{sourceName}} are replaced with the metric name and source respectively {{anyTagK}} is replaced with the value of the anyTagK point tag
        Parameters:
        input - input string with {{...}} placeholders
        reportPoint - ReportPoint object to extract components from
        Returns:
        string with substituted placeholders
      • expandPlaceholders

        public static String expandPlaceholders​(String input,
                                                ReportMetric reportMetric)
        Substitute {{...}} placeholders with corresponding components of the point {{metricName}} {{sourceName}} are replaced with the metric name and source respectively {{anyTagK}} is replaced with the value of the anyTagK point tag
        Parameters:
        input - input string with {{...}} placeholders
        reportMetric - ReportMetric object to extract components from
        Returns:
        string with substituted placeholders
      • expandPlaceholders

        public static String expandPlaceholders​(String input,
                                                ReportHistogram reportHistogram)
        Substitute {{...}} placeholders with corresponding components of the histogram {{metricName}} {{sourceName}} are replaced with the metric name and source respectively {{anyTagK}} is replaced with the value of the anyTagK point tag
        Parameters:
        input - input string with {{...}} placeholders
        reportHistogram - ReportHistogram object to extract components from
        Returns:
        string with substituted placeholders
      • expandPlaceholders

        public static String expandPlaceholders​(String input,
                                                Span span)
        Substitute {{...}} placeholders with corresponding components of a Span {{spanName}} {{sourceName}} are replaced with the span name and source respectively {{anyKey}} is replaced with the value of an annotation with anyKey key
        Parameters:
        input - input string with {{...}} placeholders
        span - Span object to extract components from
        Returns:
        string with substituted placeholders