Package org.elasticsearch.monitor.os
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 java.lang.Object implements Writeable, ToXContentFragment
Encapsulates basic cgroup statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOsStats.Cgroup.CpuStatEncapsulates CPU time statistics.-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Cgroup(java.lang.String cpuAcctControlGroup, long cpuAcctUsageNanos, java.lang.String cpuControlGroup, long cpuCfsPeriodMicros, long cpuCfsQuotaMicros, OsStats.Cgroup.CpuStat cpuStat, java.lang.String memoryControlGroup, java.lang.String memoryLimitInBytes, java.lang.String memoryUsageInBytes)
-
Method Summary
Modifier and Type Method Description java.lang.StringgetCpuAcctControlGroup()The control group for thecpuacctsubsystem.longgetCpuAcctUsageNanos()The total CPU time consumed by all tasks in thecpuacctcontrol group fromcpuAcctControlGroup.longgetCpuCfsPeriodMicros()The period of time for how frequently the control group fromcpuControlGrouphas its access to CPU resources reallocated.longgetCpuCfsQuotaMicros()The total amount of time for which all tasks in the control group fromcpuControlGroupcan run in one period as represented bycpuCfsPeriodMicros.java.lang.StringgetCpuControlGroup()The control group for thecpusubsystem.OsStats.Cgroup.CpuStatgetCpuStat()The CPU time statistics.java.lang.StringgetMemoryControlGroup()The control group for thememorysubsystem.java.lang.StringgetMemoryLimitInBytes()The maximum amount of user memory (including file cache).java.lang.StringgetMemoryUsageInBytes()The total current memory usage by processes in the cgroup (in bytes).XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Constructor Detail
-
Cgroup
public Cgroup(java.lang.String cpuAcctControlGroup, long cpuAcctUsageNanos, java.lang.String cpuControlGroup, long cpuCfsPeriodMicros, long cpuCfsQuotaMicros, OsStats.Cgroup.CpuStat cpuStat, java.lang.String memoryControlGroup, java.lang.String memoryLimitInBytes, java.lang.String memoryUsageInBytes)
-
-
Method Detail
-
getCpuAcctControlGroup
public java.lang.String getCpuAcctControlGroup()
The control group for thecpuacctsubsystem.- Returns:
- the control group
-
getCpuAcctUsageNanos
public long getCpuAcctUsageNanos()
The total CPU time consumed by all tasks in thecpuacctcontrol group fromcpuAcctControlGroup.- Returns:
- the total CPU time in nanoseconds
-
getCpuControlGroup
public java.lang.String getCpuControlGroup()
The control group for thecpusubsystem.- Returns:
- the control group
-
getCpuCfsPeriodMicros
public long getCpuCfsPeriodMicros()
The period of time for how frequently the control group fromcpuControlGrouphas 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 fromcpuControlGroupcan run in one period as represented bycpuCfsPeriodMicros.- Returns:
- the total amount of time in microseconds
-
getCpuStat
public OsStats.Cgroup.CpuStat getCpuStat()
The CPU time statistics. SeeOsStats.Cgroup.CpuStat.- Returns:
- the CPU time statistics.
-
getMemoryControlGroup
public java.lang.String getMemoryControlGroup()
The control group for thememorysubsystem.- Returns:
- the control group
-
getMemoryLimitInBytes
public java.lang.String getMemoryLimitInBytes()
The maximum amount of user memory (including file cache). This is stored as aStringbecause the value can be too big to fit in along. (The alternative would have beenBigIntegerbut then it would not be possible to index the OS stats document into Elasticsearch without losing information, asBigIntegeris not a supported Elasticsearch type.)- Returns:
- the maximum amount of user memory (including file cache).
-
getMemoryUsageInBytes
public java.lang.String getMemoryUsageInBytes()
The total current memory usage by processes in the cgroup (in bytes). This is stored as aStringfor consistency withmemoryLimitInBytes.- Returns:
- the total current memory usage by processes in the cgroup (in bytes).
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
-