Class DimensionKey

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

public final class DimensionKey extends Object
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) return true.

  • Constructor Details

    • DimensionKey

      public DimensionKey()
      Creates a new instance of DimensionKey.
    • DimensionKey

      public DimensionKey(Map<String,String> 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

    • 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.
    • 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.
    • 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.
    • asMap

      public Map<String,String> 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:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object