[Core] fix wrong memory size reporting #21089

The current resource reporting is run in OSS. Revert the change. For example it reported

InitialConfigResources: {node:172.31.45.118: 1.000000}, {object_store_memory: 468605759.960938 GiB},
For 10GB memory object_store.
This commit is contained in:
Chen Shen 2021-12-15 10:24:35 -08:00 committed by GitHub
parent 33b6cd9105
commit 03e05df9cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -197,8 +197,7 @@ double ResourceSet::GetNumCpusAsDouble() const {
std::string format_resource(std::string resource_name, double quantity) {
if (resource_name == "object_store_memory" ||
resource_name.find(kMemory_ResourceLabel) == 0) {
// The memory resources (in 50MiB unit) are converted to GiB
return std::to_string(quantity * 50 / 1024) + " GiB";
return std::to_string(quantity / (1024 * 1024 * 1024)) + " GiB";
}
return std::to_string(quantity);
}