Skip to main content
Version: edge

system

The system namespace contains functions that provide information about the tremor runtime system.

Functions

hostname()

Returns the name of the host where tremor is running.

use tremor::system;
let hostname = system::hostname();

Returns a string

ingest_ns()

Returns the ingest time into tremor of the current event.

use tremor::system;
let ingest_ns = system::ingest_ns();

Returns an int

instance()

Returns the instance name of this tremor process.

use tremor::system;
match system::instance() of
case "tremor" => "default"
# Instance names can be customized by users
# TREMOR_PATH=/path/to/lib tremor -i "bob" ...
case _ => "changed by user"
end

Returns a string

nanotime()

Returns the current time in epoch nanoseconds

WARNING: This function is expensive, please avoid using it. If you can use ingest_ns instead. ingest_ns is virtually free as it is genreated only once per event.

use tremor::system;
let now = system::nanotime();
true == system::nanotime() >= now

Returns an int

version()

Returns the tremor version as a string

use tremor::system;
let version = system::version();

Returns a string