-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
topology-aware: implement metrics collection. #392
Conversation
bf77d0c
to
f2b8541
Compare
var metrics []prometheus.Metric | ||
|
||
metrics = append(metrics, | ||
prometheus.MustNewConstMetric( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the use of "throwaway" const metric? I'd think about initializing a list of persistent gauges and using the Set method to update the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I mindlessly copied the pattern of implementation from balloons without understanding what I am actually doing... Let me try to read up on this a bit more and fix it.
@@ -45,6 +45,11 @@ func (a *Allocator) ZoneFree(zone NodeMask) int64 { | |||
return a.zoneFree(zone & a.masks.nodes.hasMemory) | |||
} | |||
|
|||
// ZoneAvailable returns the amount of available memory in the zone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of "available" is not very clear to me. Maybe this public method comment could help understanding why ZoneAvailable != ZoneFree (where ZoneFree = ZoneCapacity - ZoneUsage). Can it be that ZoneAvailable at t=0 is smaller than ZoneUsage at t=1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZoneFree returns the amount of free capacity in this zone, taking into account allocations in this zone and any only this zone and its subzones. ZoneAvailable returns ZoneFree capped to the minimum free capacity of any of the (larger super-)zones this zone is a genuine subzone of. IOW, it returns the amount of memory allocatable from this zone.
Beside these comments, I think this already looks very good. |
Add ZoneAvailable to return the amount of available/allocatable memory in a zone, capped by the amount of free memory in any of the ancestors of a zone. Signed-off-by: Krisztian Litkey <[email protected]>
Implement collection of per zone prometheus metrics. Currently we collect for each pool/zone the following - name, cpuset and memset - shared pool capacity, allocation, available amount - memory capacity, allocation, available amount - number of containers - number of containers in the shared pool Signed-off-by: Krisztian Litkey <[email protected]>
f2b8541
to
637f48a
Compare
Implement metrics collection for the topology-aware policy. Collect per zone (IOW per pool) prometheus