mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #548 from cheng--zhang/CA-149851
CA-149851: Show hyphen if used memory have negative value
This commit is contained in:
commit
77bd9188ef
@ -103,7 +103,7 @@ namespace XenAdmin.XenSearch
|
||||
double free = MetricUpdater.GetValue(vm, "memory_internal_free");
|
||||
double total = MetricUpdater.GetValue(vm, "memory");
|
||||
|
||||
if (total == 0 || Double.IsNaN(total) || Double.IsNaN(free))
|
||||
if (total == 0 || Double.IsNaN(total) || Double.IsNaN(free) || total < (free * Util.BINARY_KILO))
|
||||
return Messages.HYPHEN;
|
||||
|
||||
return String.Format(Messages.QUERY_MEMORY_USAGE, Util.MemorySizeStringWithoutUnits((total - (free * Util.BINARY_KILO))), Util.MemorySizeString(total));
|
||||
|
Loading…
Reference in New Issue
Block a user