All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.pi.model.ResponseResourceMetricKey.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.pi.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object describing a Performance Insights metric and one or more dimensions for that metric.
 */
public class ResponseResourceMetricKey private constructor(builder: Builder) {
    /**
     * The valid dimensions for the metric.
     */
    public val dimensions: Map? = builder.dimensions
    /**
     * The name of a Performance Insights metric to be measured.
     *
     * Valid values for `Metric` are:
     * + `db.load.avg` - A scaled representation of the number of active sessions for the database engine.
     * + `db.sampledload.avg` - The raw number of active sessions for the database engine.
     * + The counter metrics listed in [Performance Insights operating system counters](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS) in the *Amazon Aurora User Guide*.
     * + The counter metrics listed in [Performance Insights operating system counters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS) in the *Amazon RDS User Guide*.
     *
     * If the number of active sessions is less than an internal Performance Insights threshold, `db.load.avg` and `db.sampledload.avg` are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with `db.load.avg` showing the scaled values, `db.sampledload.avg` showing the raw values, and `db.sampledload.avg` less than `db.load.avg`. For most use cases, you can query `db.load.avg` only.
     */
    public val metric: kotlin.String = requireNotNull(builder.metric) { "A non-null value must be provided for metric" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.pi.model.ResponseResourceMetricKey = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ResponseResourceMetricKey(")
        append("dimensions=$dimensions,")
        append("metric=$metric")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = dimensions?.hashCode() ?: 0
        result = 31 * result + (metric.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as ResponseResourceMetricKey

        if (dimensions != other.dimensions) return false
        if (metric != other.metric) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.pi.model.ResponseResourceMetricKey = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The valid dimensions for the metric.
         */
        public var dimensions: Map? = null
        /**
         * The name of a Performance Insights metric to be measured.
         *
         * Valid values for `Metric` are:
         * + `db.load.avg` - A scaled representation of the number of active sessions for the database engine.
         * + `db.sampledload.avg` - The raw number of active sessions for the database engine.
         * + The counter metrics listed in [Performance Insights operating system counters](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS) in the *Amazon Aurora User Guide*.
         * + The counter metrics listed in [Performance Insights operating system counters](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights_Counters.html#USER_PerfInsights_Counters.OS) in the *Amazon RDS User Guide*.
         *
         * If the number of active sessions is less than an internal Performance Insights threshold, `db.load.avg` and `db.sampledload.avg` are the same value. If the number of active sessions is greater than the internal threshold, Performance Insights samples the active sessions, with `db.load.avg` showing the scaled values, `db.sampledload.avg` showing the raw values, and `db.sampledload.avg` less than `db.load.avg`. For most use cases, you can query `db.load.avg` only.
         */
        public var metric: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pi.model.ResponseResourceMetricKey) : this() {
            this.dimensions = x.dimensions
            this.metric = x.metric
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.pi.model.ResponseResourceMetricKey = ResponseResourceMetricKey(this)

        internal fun correctErrors(): Builder {
            if (metric == null) metric = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy