Class TimeseriesUtils
- java.lang.Object
-
- org.opennms.netmgt.timeseries.util.TimeseriesUtils
-
public final class TimeseriesUtils extends Object
Utility functions and constants.- Author:
- jwhite
-
-
Field Summary
Fields Modifier and Type Field Description static String
PREFIX_EXTERNAL_TAG
static int
WILDCARD_INDEX_NO
-
Constructor Summary
Constructors Constructor Description TimeseriesUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.opennms.integration.api.v1.timeseries.Sample
createSampleForIndexingStrings(String resourceId, Map<String,String> attributes)
Creates a sample used to index string attributes.static String
toMetricName(String resourceId)
Extracts the metric name from the resource id.static String
toResourceId(ResourcePath path)
Converts aResourcePath
to a String.static ResourcePath
toResourcePath(String resourceId)
Converts a String to aResourcePath
.static String
toSearchRegex(ResourcePath path, int depth)
-
-
-
Field Detail
-
PREFIX_EXTERNAL_TAG
public static final String PREFIX_EXTERNAL_TAG
- See Also:
- Constant Field Values
-
WILDCARD_INDEX_NO
public static final int WILDCARD_INDEX_NO
- See Also:
- Constant Field Values
-
-
Method Detail
-
toResourceId
public static String toResourceId(ResourcePath path)
Converts aResourcePath
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 aResourcePath
. 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.
-
toSearchRegex
public static String toSearchRegex(ResourcePath path, int depth)
-
-