Class TimeseriesUtils


  • public final class TimeseriesUtils
    extends Object
    Utility functions and constants.
    Author:
    jwhite
    • Constructor Detail

      • TimeseriesUtils

        public TimeseriesUtils()
    • Method Detail

      • toResourceId

        public static String toResourceId​(ResourcePath path)
        Converts a ResourcePath to a String. The elements are separated by a slash ('/'). No escaping is done. Reverse function to toResourcePath()
      • toResourcePath

        public static ResourcePath toResourcePath​(String resourceId)
        Converts a String to a ResourcePath. The last element is treated as the resource name and not returned.
        Parameters:
        resourceId - String with elements separated by a slash ('/').
      • toMetricName

        public static String toMetricName​(String resourceId)
        Extracts the metric name from the resource id. The last path element is used as the name.
      • createSampleForIndexingStrings

        public static org.opennms.integration.api.v1.timeseries.Sample createSampleForIndexingStrings​(String resourceId,
                                                                                                      Map<String,​String> attributes)
        Creates a sample used to index string attributes. These should only be index and not be persisted.