resgroup: fix the cpu value of the per host status view
Resource group we does not distinguish the per segment cpu usage, the
cpu usage reported by a segment is actually the total cpu usage of all
the segments on the host. This is by design, not a bug. However, in
the gp_toolkit.gp_resgroup_status_per_host view it reports the cpu usage
as the sum of all the segments on the same host, so the reported per
host cpu usage is actually N times of the actual usage, where N is the
count of the segments on that host.
Fixed by reporting the avg() instead of the sum().
Tests are not provided as the resgroup/resgroup_views did not verify cpu
usages since the beginning, because the cpu usage is unstable on
pipelines. However, I have verified manually.
Reviewed-by: NHubert Zhang <hzhang@pivotal.io>
Showing
想要评论请 注册 或 登录