Mercurial > hg > orthanc
changeset 240:2766fac53c81
fix
author | jodogne |
---|---|
date | Fri, 30 Nov 2012 16:48:51 +0100 |
parents | 30887f3593dd |
children | 391e7a9de203 |
files | OrthancServer/ServerIndex.cpp |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/ServerIndex.cpp Fri Nov 30 16:10:06 2012 +0100 +++ b/OrthancServer/ServerIndex.cpp Fri Nov 30 16:48:51 2012 +0100 @@ -352,6 +352,8 @@ void ServerIndex::ComputeStatistics(Json::Value& target) { + static const uint64_t MB = 1024 * 1024; + boost::mutex::scoped_lock lock(mutex_); target = Json::objectValue; @@ -359,8 +361,8 @@ uint64_t us = db_->GetTotalUncompressedSize(); target["TotalDiskSpace"] = boost::lexical_cast<std::string>(cs); target["TotalUncompressedSize"] = boost::lexical_cast<std::string>(us); - target["TotalDiskSpaceMB"] = boost::lexical_cast<unsigned int>(cs / (1024llu * 1024llu)); - target["TotalUncompressedSizeMB"] = boost::lexical_cast<unsigned int>(us / (1024llu * 1024llu)); + target["TotalDiskSpaceMB"] = boost::lexical_cast<unsigned int>(cs / MB); + target["TotalUncompressedSizeMB"] = boost::lexical_cast<unsigned int>(us / MB); target["CountPatients"] = static_cast<unsigned int>(db_->GetResourceCount(ResourceType_Patient)); target["CountStudies"] = static_cast<unsigned int>(db_->GetResourceCount(ResourceType_Study));