Class MetricData.Builder

  • Enclosing class:
    MetricData

    public static class MetricData.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • namespace

        public MetricData.Builder namespace​(String namespace)
        The reference provided in a metric definition to indicate the source service or application that emitted the metric.

        Example: oci_computeagent

        Parameters:
        namespace - the value to set
        Returns:
        this builder
      • resourceGroup

        public MetricData.Builder resourceGroup​(String resourceGroup)
        Resource group provided with the posted metric.

        A resource group is a custom string that you can match when retrieving custom metrics. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($).

        Example: frontend-fleet

        Parameters:
        resourceGroup - the value to set
        Returns:
        this builder
      • compartmentId

        public MetricData.Builder compartmentId​(String compartmentId)
        The OCID of the compartment containing the resources that the aggregated data was returned from.
        Parameters:
        compartmentId - the value to set
        Returns:
        this builder
      • name

        public MetricData.Builder name​(String name)
        The name of the metric.

        Example: CpuUtilization

        Parameters:
        name - the value to set
        Returns:
        this builder
      • dimensions

        public MetricData.Builder dimensions​(Map<String,​String> dimensions)
        Qualifiers provided in the definition of the returned metric.

        Available dimensions vary by metric namespace. Each dimension takes the form of a key-value pair.

        Example: {"resourceId": "ocid1.instance.region1.phx.exampleuniqueID"}

        Parameters:
        dimensions - the value to set
        Returns:
        this builder
      • metadata

        public MetricData.Builder metadata​(Map<String,​String> metadata)
        The references provided in a metric definition to indicate extra information about the metric.

        Example: "unit": "bytes"

        Parameters:
        metadata - the value to set
        Returns:
        this builder
      • resolution

        public MetricData.Builder resolution​(String resolution)
        The time between calculated aggregation windows.

        Use with the query interval to vary the frequency for returning aggregated data points. For example, use a query interval of 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute frequency. The resolution must be equal or less than the interval in the query. The default resolution is 1m (one minute). Supported values: 1m- 60m, 1h-24h, 1d.

        Example: 5m

        Parameters:
        resolution - the value to set
        Returns:
        this builder
      • aggregatedDatapoints

        public MetricData.Builder aggregatedDatapoints​(List<AggregatedDatapoint> aggregatedDatapoints)
        The list of timestamp-value pairs returned for the specified request.

        Metric values are rolled up to the start time specified in the request. For important limits information related to data points, see MetricData Reference at the top of this page.

        Parameters:
        aggregatedDatapoints - the value to set
        Returns:
        this builder