Package org.elasticsearch.monitor.os
Class OsStats.Cgroup
org.elasticsearch.monitor.os.OsStats.Cgroup
- All Implemented Interfaces:
Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
- Enclosing class:
- OsStats
public static class OsStats.Cgroup
extends
implements Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Encapsulates basic cgroup statistics.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Encapsulates CPU time statistics.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.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
ConstructorDescriptioncpuAcctControlGroup, long cpuAcctUsageNanos, cpuControlGroup, long cpuCfsPeriodMicros, long cpuCfsQuotaMicros, OsStats.Cgroup.CpuStat cpuStat, memoryControlGroup, memoryLimitInBytes, memoryUsageInBytes)
-
Method Summary
Modifier and TypeMethodDescriptionThe control group for thecpuacct
subsystem.long
The total CPU time consumed by all tasks in thecpuacct
control group fromcpuAcctControlGroup
.long
The period of time for how frequently the control group fromcpuControlGroup
has its access to CPU resources reallocated.long
The total amount of time for which all tasks in the control group fromcpuControlGroup
can run in one period as represented bycpuCfsPeriodMicros
.The control group for thecpu
subsystem.The CPU time statistics.The control group for thememory
subsystem.The maximum amount of user memory (including file cache).The total current memory usage by processes in the cgroup (in bytes).org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.
, , , , , , , , , ,
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
Cgroup
public Cgroup( cpuAcctControlGroup, long cpuAcctUsageNanos, cpuControlGroup, long cpuCfsPeriodMicros, long cpuCfsQuotaMicros, OsStats.Cgroup.CpuStat cpuStat, memoryControlGroup, memoryLimitInBytes, memoryUsageInBytes)
-
-
Method Details
-
getCpuAcctControlGroup
public getCpuAcctControlGroup()The control group for thecpuacct
subsystem.- Returns:
- the control group
-
getCpuAcctUsageNanos
public long getCpuAcctUsageNanos()The total CPU time consumed by all tasks in thecpuacct
control group fromcpuAcctControlGroup
.- Returns:
- the total CPU time in nanoseconds
-
getCpuControlGroup
public getCpuControlGroup()The control group for thecpu
subsystem.- Returns:
- the control group
-
getCpuCfsPeriodMicros
public long getCpuCfsPeriodMicros()The period of time for how frequently the control group fromcpuControlGroup
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 fromcpuControlGroup
can run in one period as represented bycpuCfsPeriodMicros
.- Returns:
- the total amount of time in microseconds
-
getCpuStat
The CPU time statistics. SeeOsStats.Cgroup.CpuStat
.- Returns:
- the CPU time statistics.
-
getMemoryControlGroup
public getMemoryControlGroup()The control group for thememory
subsystem.- Returns:
- the control group
-
getMemoryLimitInBytes
public getMemoryLimitInBytes()The maximum amount of user memory (including file cache). This is stored as aString
because the value can be too big to fit in along
. (The alternative would have beenBigInteger
but then it would not be possible to index the OS stats document into Elasticsearch without losing information, asBigInteger
is not a supported Elasticsearch type.)- Returns:
- the maximum amount of user memory (including file cache).
-
getMemoryUsageInBytes
public getMemoryUsageInBytes()The total current memory usage by processes in the cgroup (in bytes). This is stored as aString
for consistency withmemoryLimitInBytes
.- Returns:
- the total current memory usage by processes in the cgroup (in bytes).
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
-