expose page cache size
This commit is contained in:
parent
1a867bdadd
commit
a26b58ec8e
@ -378,6 +378,7 @@ func toContainerStats1(s *cgroups.Stats, ret *info.ContainerStats) {
|
|||||||
func toContainerStats2(s *cgroups.Stats, ret *info.ContainerStats) {
|
func toContainerStats2(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||||
ret.Memory.Usage = s.MemoryStats.Usage.Usage
|
ret.Memory.Usage = s.MemoryStats.Usage.Usage
|
||||||
ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt
|
ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt
|
||||||
|
ret.Memory.Cache = s.MemoryStats.Stats["cache"]
|
||||||
ret.Memory.RSS = s.MemoryStats.Stats["rss"]
|
ret.Memory.RSS = s.MemoryStats.Stats["rss"]
|
||||||
if v, ok := s.MemoryStats.Stats["pgfault"]; ok {
|
if v, ok := s.MemoryStats.Stats["pgfault"]; ok {
|
||||||
ret.Memory.ContainerData.Pgfault = v
|
ret.Memory.ContainerData.Pgfault = v
|
||||||
|
@ -308,6 +308,10 @@ type MemoryStats struct {
|
|||||||
// Units: Bytes.
|
// Units: Bytes.
|
||||||
Usage uint64 `json:"usage"`
|
Usage uint64 `json:"usage"`
|
||||||
|
|
||||||
|
// Number of bytes of page cache memory.
|
||||||
|
// Units: Bytes.
|
||||||
|
Cache uint64 `json:"cache"`
|
||||||
|
|
||||||
// The amount of anonymous and swap cache memory (includes transparent
|
// The amount of anonymous and swap cache memory (includes transparent
|
||||||
// hugepages).
|
// hugepages).
|
||||||
// Units: Bytes.
|
// Units: Bytes.
|
||||||
|
@ -127,6 +127,13 @@ func NewPrometheusCollector(infoProvider infoProvider, f ContainerNameToLabelsFu
|
|||||||
}
|
}
|
||||||
return values
|
return values
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
name: "container_memory_cache",
|
||||||
|
help: "Number of bytes of page cache memory.",
|
||||||
|
valueType: prometheus.GaugeValue,
|
||||||
|
getValues: func(s *info.ContainerStats) metricValues {
|
||||||
|
return metricValues{{value: float64(s.Memory.Cache)}}
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
name: "container_memory_rss",
|
name: "container_memory_rss",
|
||||||
help: "Size of RSS in bytes",
|
help: "Size of RSS in bytes",
|
||||||
|
Loading…
Reference in New Issue
Block a user