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

com.avito.k8s.PodCollectionExtensions.kt Maven / Gradle / Ivy

Go to download

Collection of infrastructure libraries and gradle plugins of Avito Android project

There is a newer version: 2024.32
Show newest version
package com.avito.k8s

import com.avito.k8s.model.KubePod

public fun Collection.describePods(deploymentName: String): String {
    val pods = this
    return buildString {
        appendLine("Getting pods for deployment: $deploymentName:")
        appendLine("----------------")

        pods.forEach { pod -> appendLine(pod.toString()) }

        val runningCount = pods.count { it.phase == KubePod.PodPhase.Running }
        val pendingCount = pods.count { it.phase is KubePod.PodPhase.Pending }
        val otherCount = pods.size - runningCount - pendingCount

        append(
            "------- Summary: " +
                "running: $runningCount; " +
                "pending: $pendingCount; " +
                "other $otherCount  ---------"
        )
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy