CLOUDSTACK-2545: Change unit of network statistics from 1000 to 1024 for KVM

Signed-off-by: Chip Childers <chip.childers@gmail.com>
This commit is contained in:
Wei Zhou 2013-05-16 22:07:03 +01:00 committed by Chip Childers
parent d078f92167
commit a29e39365a
1 changed files with 3 additions and 3 deletions

View File

@ -2842,7 +2842,7 @@ ServerResource {
Pair<Double, Double> nicStats = getNicStats(_publicBridgeName);
HostStatsEntry hostStats = new HostStatsEntry(cmd.getHostId(), cpuUtil,
nicStats.first() / 1000, nicStats.second() / 1000, "host",
nicStats.first() / 1024, nicStats.second() / 1024, "host",
totMem, freeMem, 0, 0);
return new GetHostStatsAnswer(cmd, hostStats);
}
@ -4561,10 +4561,10 @@ ServerResource {
if (oldStats != null) {
long deltarx = rx - oldStats._rx;
if (deltarx > 0)
stats.setNetworkReadKBs(deltarx / 1000);
stats.setNetworkReadKBs(deltarx / 1024);
long deltatx = tx - oldStats._tx;
if (deltatx > 0)
stats.setNetworkWriteKBs(deltatx / 1000);
stats.setNetworkWriteKBs(deltatx / 1024);
}
vmStats newStat = new vmStats();