package com.atlassian.bitbucket.mesh.platform;

import javax.annotation.Nonnull;
import java.util.OptionalDouble;
import java.util.OptionalLong;

/**
 * A service that provides information on the current state of the operating system.
 */
public interface OperatingSystemService {

    /**
     * Retrieves the current CPU load across all processors as a value between 0.0 and 1.0.
     *
     * @return the current CPU load or {@link OptionalDouble#empty() an empty value} if this is unavailable.
     */
    @Nonnull
    OptionalDouble getCpuLoad();

    /**
     * Retrieves the total physical memory of the machine in bytes.
     *
     * @return the total physical memory of the machine in bytes or {@link OptionalLong#empty() an empty value} if
     * this is unavailable.
     */
    @Nonnull
    OptionalLong getTotalPhysicalMemory();
}
