Class TimeseriesUtils
- java.lang.Object
-
- org.opennms.netmgt.timeseries.util.TimeseriesUtils
-
public final class TimeseriesUtils extends java.lang.Object
Utility functions and constants.- Author:
- jwhite
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.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(java.lang.String resourceId, java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a sample used to index string attributes.static java.lang.String
toMetricName(java.lang.String resourceId)
Extracts the metric name from the resource id.static java.lang.String
toResourceId(ResourcePath path)
Converts aResourcePath
to a String.static ResourcePath
toResourcePath(java.lang.String resourceId)
Converts a String to aResourcePath
.static java.lang.String
toSearchRegex(ResourcePath path, int depth)
-
-
-
Field Detail
-
PREFIX_EXTERNAL_TAG
public static final java.lang.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 java.lang.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(java.lang.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 java.lang.String toMetricName(java.lang.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(java.lang.String resourceId, java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a sample used to index string attributes. These should only be index and not be persisted.
-
toSearchRegex
public static java.lang.String toSearchRegex(ResourcePath path, int depth)
-
-