Class OsStats.Cgroup

java.lang.Object
org.elasticsearch.monitor.os.OsStats.Cgroup
All Implemented Interfaces:
Writeable, ToXContent, ToXContentFragment
Enclosing class:
OsStats

public static class OsStats.Cgroup extends Object implements Writeable, ToXContentFragment
Encapsulates basic cgroup statistics.
  • Constructor Details

    • Cgroup

      public Cgroup(String cpuAcctControlGroup, long cpuAcctUsageNanos, String cpuControlGroup, long cpuCfsPeriodMicros, long cpuCfsQuotaMicros, OsStats.Cgroup.CpuStat cpuStat, String memoryControlGroup, String memoryLimitInBytes, String memoryUsageInBytes)
  • Method Details

    • getCpuAcctControlGroup

      public String getCpuAcctControlGroup()
      The control group for the cpuacct subsystem.
      Returns:
      the control group
    • getCpuAcctUsageNanos

      public long getCpuAcctUsageNanos()
      The total CPU time consumed by all tasks in the cpuacct control group from cpuAcctControlGroup.
      Returns:
      the total CPU time in nanoseconds
    • getCpuControlGroup

      public String getCpuControlGroup()
      The control group for the cpu subsystem.
      Returns:
      the control group
    • getCpuCfsPeriodMicros

      public long getCpuCfsPeriodMicros()
      The period of time for how frequently the control group from cpuControlGroup has its access to CPU resources reallocated.
      Returns:
      the period of time in microseconds
    • getCpuCfsQuotaMicros

      public long getCpuCfsQuotaMicros()
      The total amount of time for which all tasks in the control group from cpuControlGroup can run in one period as represented by cpuCfsPeriodMicros.
      Returns:
      the total amount of time in microseconds
    • getCpuStat

      public OsStats.Cgroup.CpuStat getCpuStat()
      The CPU time statistics. See OsStats.Cgroup.CpuStat.
      Returns:
      the CPU time statistics.
    • getMemoryControlGroup

      public String getMemoryControlGroup()
      The control group for the memory subsystem.
      Returns:
      the control group
    • getMemoryLimitInBytes

      public String getMemoryLimitInBytes()
      The maximum amount of user memory (including file cache). This is stored as a String because the value can be too big to fit in a long. (The alternative would have been BigInteger but then it would not be possible to index the OS stats document into Elasticsearch without losing information, as BigInteger is not a supported Elasticsearch type.)
      Returns:
      the maximum amount of user memory (including file cache).
    • getMemoryUsageInBytes

      public String getMemoryUsageInBytes()
      The total current memory usage by processes in the cgroup (in bytes). This is stored as a String for consistency with memoryLimitInBytes.
      Returns:
      the total current memory usage by processes in the cgroup (in bytes).
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface ToXContent
      Throws:
      IOException