gpperfmon: refactor to make 'skew' calculation more readable
gpperfmon: refactor to make 'skew' calculation more readable

Coefficient of Variation Calculation

Coefficient of variation is the standard deviation divided by the mean.

We're using the term skew very loosely in our description, as we're
actually calculating coefficient of variation.

With coefficient of variation, we can tell how dispersed the data points are across
the segments. The higher the coefficient of variation, the more
non-uniform the distribution of the data in cluster.

Coefficient of variation is unitless so it could be used for comparing
different clusters and how they are performing relative to each other.

CPU Skew calculation:
mean(cpu) = sum(per segment cpu cycle) / sum(segments)
variance(cpu) = sqrt( sum(((cpu(segment) - mean(cpu))^2) ... ) / sum(segments) )
std_dev(cpu) = sqrt(variance(cpu))
skew(cpu) = coeffecient of variation = std_dev(cpu)/mean(cpu)

Row out Skew calculation:
mean(row) = sum(per segment row) / sum(segments)
variance(row) = sqrt( sum(((row(segment) - mean(row))^2) ... ) / sum(segments) )
std_dev(row) = sqrt(variance(row))
skew(row) = coeffecient of variation = std_dev(row)/mean(row)

Signed-off-by: Tushar Dadlani <30e3adf538ecf64bd912d5b2c65f5b8659805406@pivotal.io>

rvs/gpdb,edespino/gpdb,jmcatamney/gpdb,Chibin/gpdb,edespino/gpdb,Quikling/gpdb,50wu/gpdb,Quikling/gpdb,jmcatamney/gpdb,xinzweb/gpdb,Quikling/gpdb,edespino/gpdb,edespino/gpdb,Quikling/gpdb,lisakowen/gpdb,xinzweb/gpdb,rvs/gpdb,Chibin/gpdb,janebeckman/gpdb,edespino/gpdb,xinzweb/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,rvs/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,rvs/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,edespino/gpdb,Quikling/gpdb,rvs/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,50wu/gpdb,cjcjameson/gpdb,cjcjameson/gpdb,janebeckman/gpdb,lisakowen/gpdb,adam8157/gpdb,yuanzhao/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,janebeckman/gpdb,lisakowen/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,rvs/gpdb,ashwinstar/gpdb,yuanzhao/gpdb,edespino/gpdb,50wu/gpdb,yuanzhao/gpdb,Quikling/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,50wu/gpdb,yuanzhao/gpdb,lisakowen/gpdb,janebeckman/gpdb,edespino/gpdb,janebeckman/gpdb,Quikling/gpdb,greenplum-db/gpdb,adam8157/gpdb,janebeckman/gpdb,cjcjameson/gpdb,50wu/gpdb,xinzweb/gpdb,edespino/gpdb,cjcjameson/gpdb,adam8157/gpdb,yuanzhao/gpdb,Chibin/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,adam8157/gpdb,kaknikhil/gpdb,Chibin/gpdb,kaknikhil/gpdb,janebeckman/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,xinzweb/gpdb,rvs/gpdb,Chibin/gpdb,janebeckman/gpdb,greenplum-db/gpdb,janebeckman/gpdb,Chibin/gpdb,50wu/gpdb,rvs/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,janebeckman/gpdb,Quikling/gpdb,xinzweb/gpdb,edespino/gpdb,adam8157/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,lisakowen/gpdb,ashwinstar/gpdb,adam8157/gpdb,Chibin/gpdb,kaknikhil/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,lisakowen/gpdb,yuanzhao/gpdb,Chibin/gpdb,lisakowen/gpdb,Chibin/gpdb,50wu/gpdb,Quikling/gpdb,rvs/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,jmcatamney/gpdb,rvs/gpdb,cjcjameson/gpdb,adam8157/gpdb,lisakowen/gpdb,Chibin/gpdb,Quikling/gpdb