public class MetricsUtil
extends java.lang.Object
| Constructor and Description |
|---|
MetricsUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.String> |
addHttpErrorAttrs(java.util.Map<java.lang.String,java.lang.String> attrs,
java.lang.Throwable ex)
Add http error attributes to the passed map of attributes
|
static java.util.Map<java.lang.String,java.lang.String> |
addHttpSuccessAttrs(java.util.Map<java.lang.String,java.lang.String> attrs)
Add http success attributes to the passed map of attributes
|
static java.util.Map<java.lang.String,java.lang.String> |
getSensorKeyAttrs(java.lang.String contextId,
java.lang.String mechanism,
java.net.URI uri,
java.lang.String kind)
Get the attributes for the sensor key using passed info.
|
static java.util.Map<java.lang.String,java.lang.String> |
getSensorKeyAttrs(java.lang.String contextId,
java.net.URI uri,
java.lang.String kind)
Get the attributes for the sensor key using passed info
|
static java.lang.String |
hostAttr(java.net.URI uri)
Extract the hostname:port from the passed url
For 'http' protocol use port 80 as the default.
|
static java.lang.String |
pathAttr(java.net.URI uri)
Resolve the raw path of the passed url
|
public static java.util.Map<java.lang.String,java.lang.String> getSensorKeyAttrs(java.lang.String contextId,
java.lang.String mechanism,
java.net.URI uri,
java.lang.String kind)
contextId - a contextIdmechanism - a SASL authentication mechanism useduri - a URI associated with the sensorkind - a 'kind' for the sensorpublic static java.util.Map<java.lang.String,java.lang.String> getSensorKeyAttrs(java.lang.String contextId,
java.net.URI uri,
java.lang.String kind)
contextId - a contextIduri - a URI associated with the sensorkind - a 'kind' for the sensorpublic static java.util.Map<java.lang.String,java.lang.String> addHttpSuccessAttrs(java.util.Map<java.lang.String,java.lang.String> attrs)
attrs - A target attributes mappublic static java.util.Map<java.lang.String,java.lang.String> addHttpErrorAttrs(java.util.Map<java.lang.String,java.lang.String> attrs,
java.lang.Throwable ex)
attrs - A target attributes mapex - The exception that occurredpublic static java.lang.String pathAttr(java.net.URI uri)
uri - a URI objectpublic static java.lang.String hostAttr(java.net.URI uri)
uri - the URI objectCopyright © 2024. All rights reserved.