summaryrefslogtreecommitdiffstats
path: root/src/util.h
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2012-04-05 13:44:36 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2012-04-19 13:29:26 (GMT)
commitb50f7d1f30991998564f62aa717862efb7555044 (patch)
tree95161e6f0fd8c201ac5bc30c0fb5bd4796ba90ce /src/util.h
parent5da8529d9c0e5fa2ad586c0608b5a936286cf9a2 (diff)
downloadNinja-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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 9b4e745..399913e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -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