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

ru.tinkoff.plugins.buildmetrics.system.labels.MemoryLabelsFactory.kt Maven / Gradle / Ivy

The newest version!
package ru.tinkoff.plugins.buildmetrics.system.labels

import ru.tinkoff.plugins.buildmetrics.api.factories.Factory
import ru.tinkoff.plugins.buildmetrics.api.labels.Label
import ru.tinkoff.plugins.buildmetrics.system.utils.TotalMemorySize
import ru.tinkoff.plugins.buildmetrics.system.utils.TotalMemorySizeImpl

/**
 * Labels:
 * - ram_total_bytes
 */
class MemoryLabelsFactory(
    private val totalMemorySize: TotalMemorySize = TotalMemorySizeImpl()
) : Factory.Labels {

    override fun create(): List> = listOf(
        ramTotalBytesLabel(),
    )

    /**
     * Total RAM label.
     *
     * Visible for testing.
     */
    internal fun ramTotalBytesLabel(): Label = Label(
        name = "ram_total_bytes",
        value = totalMemorySize.value()
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy