ArangoDB

Module "internal"

The following functions are used internally.


  1. internal.execute
  2. internal.load
  3. internal.log
  4. internal.logLevel
  5. internal.output
  6. internal.processStat
  7. internal.read
  8. internal.sprintf
  9. internal.time


internal.execute(script, sandbox, filename)
Executes the script with the sandbox as context. Global variables assigned inside the script, will be visible in the sandbox object after execution. The filename is used for displaying error messages.

If sandbox is undefined, then execute uses the current context.



internal.load(filename)
Reads in a files and executes the contents in the current context.



internal.log(level, message)
Logs the message at the given log level.

Valid log-level are:

  • fatal
  • error
  • warning
  • info
  • debug
  • trace


internal.logLevel()
Returns the current log-level as string.

arango> logLevel();
"info"

internal.logLevel(level)
Changes the current log-level. Valid log-level are:

  • fatal
  • error
  • warning
  • info
  • debug
  • trace
arango> logLevel("debug");
"debug"


internal.output(string1, string2, string3, ...)
Outputs the arguments to standard output.

arango> output("Hallo", " ", "World", "\n");
Hallo World


internal.processStat()
Returns information about the current process:

  • minorPageFaults: The number of minor faults the process has made which have not required loading a memory page from disk.
  • majorPageFaults: The number of major faults the process has made which have required loading a memory page from disk.
  • userTime: Amount of time that this process has been scheduled in user mode, measured in clock ticks.
  • systemTime: Amount of time that this process has been scheduled in kernel mode, measured in clock ticks.
  • numberThreads: Number of threads in this process.
  • residentSize: Resident Set Size: number of pages the process has in real memory. This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.
  • virtualSize: Virtual memory size in bytes.
arango> require("internal").processStat();
{ minorPageFaults : 2683, 	
  majorPageFaults : 0,
  userTime : 26,
  systemTime : 7,
  numberThreads : 4,
  residentSize : 2288,
  virtualSize : 55861248 }


internal.read(filename)
Reads in a file and returns the content as string.



internal.sprintf(format, argument1, ...)
Formats the arguments according to the format string format.



internal.time()
Returns the current time in seconds.

arango> time();
1320574890.733971

arango> time();
1320574901.318164