A class that allows to set JVM system properties and get the values of JVM system properties.
More...
|
| static bool | setProperty (StringParam key, StringParam value) |
| | Sets the JVM system property indicated by the specified key.
|
| template<typename Properties> |
| static void | setProperties (Properties &&properties) |
| | Sets the JVM system properties to the Properties argument.
|
| static std::string | getProperty (StringParam key) |
| | Gets the system property indicated by the specified key.
|
| static bool | setIsolateArguments (std::vector< std::string > arguments) |
| | Sets the arguments that the Graal isolate is created with, for example -Dmy.prop=value or -Xmx512m.
|
| static RuntimeStatistics | getRuntimeStatistics () |
| | Reads the runtime statistics of the Graal isolate of the library and of its process: the heap, the garbage collections, the threads, the CPU time of the process and the uptime.
|
| static std::optional< std::string > | getBuildInfo (StringParam key) |
| | Returns a value that tells how the Graal Native SDK library was built and what runs it: the version of QDS, the vendor of the runtime, the target machine and the garbage collectors (the BUILD_INFO_ keys).
|
|
|
static constexpr char | BUILD_INFO_QD_VERSION [] = "qd_version" |
| | The key of getBuildInfo() for the version of QDS that the Graal Native SDK library is built with, e.g. 3.358.
|
| static constexpr char | BUILD_INFO_VENDOR [] = "vendor" |
| | The key of getBuildInfo() for the vendor and the version of the runtime that the Graal Native SDK library is built with, e.g.
|
| static constexpr char | BUILD_INFO_MARCH [] = "march" |
| | The key of getBuildInfo() for the target machine of the build of the Graal Native SDK library (-march of native-image), e.g.
|
|
static constexpr char | BUILD_INFO_GC [] = "gc" |
| | The key of getBuildInfo() for the garbage collectors of the runtime of the Graal Native SDK library, separated by , .
|
A class that allows to set JVM system properties and get the values of JVM system properties.
| std::optional< std::string > System::getBuildInfo |
( |
StringParam | key | ) |
|
|
static |
Returns a value that tells how the Graal Native SDK library was built and what runs it: the version of QDS, the vendor of the runtime, the target machine and the garbage collectors (the BUILD_INFO_ keys).
A tool records them next to its measurements, as the NetTest summary does (tool.qd_version and tool.build).
An unknown key, also an empty one, is not an error: the result is empty, as it is for a value that the library does not know (BUILD_INFO_MARCH of an iOS library). The values are for display and records: their text may change with the runtime or the build, so a program must not parse them. A newer SDK may add keys: they are read with the same function. The call creates the isolate if it is not created yet.
static constexpr char BUILD_INFO_QD_VERSION[]
The key of getBuildInfo() for the version of QDS that the Graal Native SDK library is built with,...
Definition System.hpp:172
static std::optional< std::string > getBuildInfo(StringParam key)
Returns a value that tells how the Graal Native SDK library was built and what runs it: the version o...
Definition System.cpp:93
- Parameters
-
| key | The key (UTF-8 string), one of the BUILD_INFO_ keys. |
- Returns
- The value (UTF-8 string), or an empty optional.
- Exceptions
-
Reads the runtime statistics of the Graal isolate of the library and of its process: the heap, the garbage collections, the threads, the CPU time of the process and the uptime.
A value that the platform or the garbage collector does not give is -1, and the call still succeeds (see RuntimeStatistics).
Reading changes nothing: the counters are cumulative since the isolate started, and the caller computes the change between two calls. The first call initializes the sources and may take some milliseconds: call it once at start-up to take the cost out of a measurement. The call creates the isolate if it is not created yet.
- Returns
- The runtime statistics.
- Exceptions
-
| RuntimeException | if the Graal Native SDK library does not support the runtime statistics (the message names the feature and the version of the library). |
| JavaException | if the Graal Native SDK failed to read the statistics. |
| GraalException | if the creation of the isolate failed (Isolate arguments) or the library is shut down (dxfcpp::shutdown()). |