DimensionKey Class
- java.
lang. Object - com.
azure. ai. metricsadvisor. models. DimensionKey
- com.
public final class DimensionKey
Describes a Data Feed Metric dimension name-value pairs.
A metric advisor data feed schema DataFeedSchema defines dimension names and metric for a data source, For example, a SQL data source for a wholesale company can have "product_category" and "city" as dimension names and "revenue" as a metric.
A combination of value for all dimension names identifies a metric time-series. A DimensionKey can hold such a combination, for example, [ product_category=men-shoes, city=redmond ] identifies one specific time-series.
A DimensionKey can also have partial dimensions, for example, [ city=redmond ] identifying a group of time-series having value for "city" dimension as "redmond".
Two DimensionKey with same dimension name-value pairs identifies the same time-series or time-series group, this means equals(Object o) return true
.
Constructor Summary
Constructor | Description |
---|---|
DimensionKey() |
Creates a new instance of Dimension |
DimensionKey(Map<String,String> dimensionNameValue) |
Creates a new instance of Dimension |
Method Summary
Modifier and Type | Method and Description |
---|---|
Map<String,String> |
asMap()
Gets the dimension name-value pairs in the key as a map. |
boolean | equals(Object o) |
String |
get(String dimensionName)
Gets dimension value for the given |
int | hashCode() |
Dimension |
put(String dimensionName, String dimensionValue)
Adds a dimension name-value to the key. |
Dimension |
remove(String dimensionName)
Removes a dimension name-value from the key. |
Methods inherited from java.lang.Object
Constructor Details
DimensionKey
public DimensionKey()
Creates a new instance of DimensionKey.
DimensionKey
public DimensionKey(Map
Creates a new instance of DimensionKey that is initialized with the provided map of dimension name-value pairs.
Parameters:
Method Details
asMap
public Map
Gets the dimension name-value pairs in the key as a map.
Returns:
equals
public boolean equals(Object o)
Overrides:
DimensionKey.equals(Object o)Parameters:
get
public String get(String dimensionName)
Gets dimension value for the given dimensionName
.
Parameters:
Returns:
null
otherwise.hashCode
public int hashCode()
Overrides:
DimensionKey.hashCode()put
public DimensionKey put(String dimensionName, String dimensionValue)
Adds a dimension name-value to the key.
Parameters:
Returns:
remove
public DimensionKey remove(String dimensionName)
Removes a dimension name-value from the key.
Parameters:
Returns:
Applies to
Azure SDK for Java