diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2012-04-05 13:44:36 (GMT) |
---|---|---|
committer | Nicolas Despres <nicolas.despres@gmail.com> | 2012-04-19 13:29:26 (GMT) |
commit | b50f7d1f30991998564f62aa717862efb7555044 (patch) | |
tree | 95161e6f0fd8c201ac5bc30c0fb5bd4796ba90ce /src/util.h | |
parent | 5da8529d9c0e5fa2ad586c0608b5a936286cf9a2 (diff) | |
download | Ninja-b50f7d1f30991998564f62aa717862efb7555044.zip Ninja-b50f7d1f30991998564f62aa717862efb7555044.tar.gz Ninja-b50f7d1f30991998564f62aa717862efb7555044.tar.bz2 |
Add -l N option to limit the load average.
This is similar to GNU make -l/--load-average option. It limits the number
of job started if the load average exceed the given value. It can be very
useful when running ninja on a continuous integration server where we want
to use parallelism as much as possible without overloading the server.
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -68,6 +68,10 @@ const char* SpellcheckString(const string& text, ...); /// Removes all Ansi escape codes (http://www.termsys.demon.co.uk/vtansi.htm). string StripAnsiEscapeCodes(const string& in); +/// @return the load average of the machine. A negative value is returned +/// on error. +double GetLoadAverage(); + #ifdef _MSC_VER #define snprintf _snprintf #define fileno _fileno |