Compartir a través de


DimensionKey Class

  • java.lang.Object
    • com.azure.ai.metricsadvisor.models.DimensionKey

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 DimensionKey.

DimensionKey(Map<String,String> dimensionNameValue)

Creates a new instance of DimensionKey that is initialized with the provided map of dimension name-value pairs.

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 dimensionName.

int hashCode()
DimensionKey put(String dimensionName, String dimensionValue)

Adds a dimension name-value to the key.

DimensionKey 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 dimensionNameValue)

Creates a new instance of DimensionKey that is initialized with the provided map of dimension name-value pairs.

Parameters:

dimensionNameValue - The map of dimension name values.

Method Details

asMap

public Map asMap()

Gets the dimension name-value pairs in the key as a map.

Returns:

The dimension name-value map.

equals

public boolean equals(Object o)

Overrides:

DimensionKey.equals(Object o)

Parameters:

o

get

public String get(String dimensionName)

Gets dimension value for the given dimensionName.

Parameters:

dimensionName - The dimension name.

Returns:

The dimension value if exists, 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:

dimensionName - The dimension name.
dimensionValue - The dimension value.

Returns:

The DimensionKey object itself.

remove

public DimensionKey remove(String dimensionName)

Removes a dimension name-value from the key.

Parameters:

dimensionName - The name of the dimension to remove.

Returns:

The DimensionKey object itself.

Applies to