未验证 提交 e0d78729 编写于 作者: N Ning Yu 提交者: GitHub

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>
上级 46d9e26a
......@@ -1845,7 +1845,7 @@ CREATE VIEW gp_toolkit.gp_resgroup_status_per_host AS
s.rsgname
, s.groupid
, c.hostname
, sum((s.cpu )::text::numeric) AS cpu
, round(avg((s.cpu)::text::numeric), 2) AS cpu
, sum((s.memory->'used' )::text::integer) AS memory_used
, sum((s.memory->'available' )::text::integer) AS memory_available
, sum((s.memory->'quota_used' )::text::integer) AS memory_quota_used
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册