Add an 'optimiseStore' remote procedure call.

This commit is contained in:
Ludovic Courtès 2014-09-01 22:21:42 +02:00 committed by Eelco Dolstra
parent 27a01d92c2
commit 8fb8c26b6d
8 changed files with 42 additions and 20 deletions

View file

@ -225,6 +225,22 @@ void LocalStore::optimiseStore(OptimiseStats & stats)
}
}
static string showBytes(unsigned long long bytes)
{
return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str();
}
void LocalStore::optimiseStore()
{
OptimiseStats stats;
optimiseStore(stats);
printMsg(lvlError,
format("%1% freed by hard-linking %2% files")
% showBytes(stats.bytesFreed)
% stats.filesLinked);
}
void LocalStore::optimisePath(const Path & path)
{