summaryrefslogtreecommitdiffstats
path: root/vespalib/src/apps/vespa-resource-limits
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib/src/apps/vespa-resource-limits')
-rw-r--r--vespalib/src/apps/vespa-resource-limits/.gitignore1
-rw-r--r--vespalib/src/apps/vespa-resource-limits/CMakeLists.txt9
-rw-r--r--vespalib/src/apps/vespa-resource-limits/resource_limits.cpp13
3 files changed, 23 insertions, 0 deletions
diff --git a/vespalib/src/apps/vespa-resource-limits/.gitignore b/vespalib/src/apps/vespa-resource-limits/.gitignore
new file mode 100644
index 00000000000..58a2938f452
--- /dev/null
+++ b/vespalib/src/apps/vespa-resource-limits/.gitignore
@@ -0,0 +1 @@
+/vespa-resource-limits
diff --git a/vespalib/src/apps/vespa-resource-limits/CMakeLists.txt b/vespalib/src/apps/vespa-resource-limits/CMakeLists.txt
new file mode 100644
index 00000000000..566b23058cf
--- /dev/null
+++ b/vespalib/src/apps/vespa-resource-limits/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+vespa_add_executable(vespalib_vespa-resource-limits_app
+ SOURCES
+ resource_limits.cpp
+ OUTPUT_NAME vespa-resource-limits
+ INSTALL bin
+ DEPENDS
+ vespalib
+)
diff --git a/vespalib/src/apps/vespa-resource-limits/resource_limits.cpp b/vespalib/src/apps/vespa-resource-limits/resource_limits.cpp
new file mode 100644
index 00000000000..59bea7d0fd8
--- /dev/null
+++ b/vespalib/src/apps/vespa-resource-limits/resource_limits.cpp
@@ -0,0 +1,13 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/vespalib/util/resource_limits.h>
+#include <iostream>
+
+int
+main(int, char**)
+{
+ auto limits = vespalib::ResourceLimits::create();
+ std::cout << "Memory limit: " << limits.memory() << '\n' <<
+ "Cpu limit: " << limits.cpu() << std::endl;
+ return 0;
+}