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

commonMain.aws.sdk.kotlin.services.codeguruprofiler.model.Metric.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.codeguruprofiler.model



/**
 * Details about the metric that the analysis used when it detected the anomaly. The metric what is analyzed to create recommendations. It includes the name of the frame that was analyzed and the type and thread states used to derive the metric value for that frame.
 */
public class Metric private constructor(builder: Builder) {
    /**
     * The name of the method that appears as a frame in any stack in a profile.
     */
    public val frameName: kotlin.String? = builder.frameName
    /**
     * The list of application runtime thread states that is used to calculate the metric value for the frame.
     */
    public val threadStates: List? = builder.threadStates
    /**
     * A type that specifies how a metric for a frame is analyzed. The supported value `AggregatedRelativeTotalTime` is an aggregation of the metric value for one frame that is calculated across the occurences of all frames in a profile.
     */
    public val type: aws.sdk.kotlin.services.codeguruprofiler.model.MetricType? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("Metric(")
        append("frameName=$frameName,")
        append("threadStates=$threadStates,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = frameName?.hashCode() ?: 0
        result = 31 * result + (threadStates?.hashCode() ?: 0)
        result = 31 * result + (type?.hashCode() ?: 0)
        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 Metric

        if (frameName != other.frameName) return false
        if (threadStates != other.threadStates) return false
        if (type != other.type) return false

        return true
    }

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

    public class Builder {
        /**
         * The name of the method that appears as a frame in any stack in a profile.
         */
        public var frameName: kotlin.String? = null
        /**
         * The list of application runtime thread states that is used to calculate the metric value for the frame.
         */
        public var threadStates: List? = null
        /**
         * A type that specifies how a metric for a frame is analyzed. The supported value `AggregatedRelativeTotalTime` is an aggregation of the metric value for one frame that is calculated across the occurences of all frames in a profile.
         */
        public var type: aws.sdk.kotlin.services.codeguruprofiler.model.MetricType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.codeguruprofiler.model.Metric) : this() {
            this.frameName = x.frameName
            this.threadStates = x.threadStates
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.codeguruprofiler.model.Metric = Metric(this)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy