Shell Runtime (runtime)

Returns runtime information on the internal state of Murex

Description

runtime is a tool for querying the internal state of Murex. It’s output will be JSON dumps.

Usage

runtime flags -> <stdout>

builtins is an alias for runtime --builtins:

builtins -> <stdout>

Examples

List all the builtin data-types that support WriteArray()

» runtime --writearray
[
    "*",
    "commonlog",
    "csexp",
    "hcl",
    "json",
    "jsonl",
    "qs",
    "sexp",
    "str",
    "toml",
    "yaml"
]

List all the functions

» runtime --functions -> [ agent aliases ]
[
    {
        "Block": "\n    # Launch ssh-agent\n    ssh-agent -\u003e head -n2 -\u003e [ :0 ] -\u003e prefix \"export \" -\u003e source\n    ssh-add: @{g \u003c!null\u003e ~/.ssh/*.key} @{g \u003c!null\u003e ~/.ssh/*.pem}\n",
        "FileRef": {
            "Column": 1,
            "Line": 149,
            "Source": {
                "DateTime": "2019-07-07T14:06:11.05581+01:00",
                "Filename": "/home/lau/.murex_profile",
                "Module": "profile/.murex_profile"
            }
        },
        "Summary": "Launch ssh-agent"
    },
    {
        "Block": "\n\t# Output the aliases in human readable format\n\truntime --aliases -\u003e formap name alias {\n        $name -\u003e sprintf \"%10s =\u003e ${esccli @alias}\\n\"\n\t} -\u003e cast str\n",
        "FileRef": {
            "Column": 1,
            "Line": 6,
            "Source": {
                "DateTime": "2019-07-07T14:06:10.886706796+01:00",
                "Filename": "(builtin)",
                "Module": "source/builtin"
            }
        },
        "Summary": "Output the aliases in human readable format"
    }
]

To get a list of every flag supported by runtime

runtime --help

Please also note that you can supply more than one flag. However when you do use multiple flags the top level of the JSON output will be a map of the flag names. eg

» runtime --pipes --tests
{
    "pipes": [
        "file",
        "std",
        "tcp-dial",
        "tcp-listen",
        "udp-dial",
        "udp-listen"
    ],
    "tests": {
        "state": {},
        "test": []
    }
}

» runtime --pipes
[
    "file",
    "std",
    "tcp-dial",
    "tcp-listen",
    "udp-dial",
    "udp-listen"
]

» runtime --tests
{
    "state": {},
    "test": []
}

Flags

Detail

Usage in scripts

runtime should not be used in scripts because the output of runtime may be subject to change as and when the internal mechanics of Murex change. The purpose behind runtime is not to provide an API but rather to provide a verbose “dump” of the internal running state of Murex.

If you require a stable API to script against then please use the respective command line tool. For example fid-list instead of runtime --fids. Some tools will provide a human readable output when stdout is a TTY but output a script parsable version when stdout is not a terminal.

» fid-list
    FID   Parent    Scope  State         Run Mode  BG   Out Pipe    Err Pipe    Command     Parameters
      0        0        0  Executing     Shell     no                           -murex
 265499        0        0  Executing     Normal    no   out         err         fid-list

» fid-list -> pretty
[
    {
        "FID": 0,
        "Parent": 0,
        "Scope": 0,
        "State": "Executing",
        "Run Mode": "Shell",
        "BG": false,
        "Out Pipe": "",
        "Err Pipe": "",
        "Command": "-murex",
        "Parameters": ""
    },
    {
        "FID": 265540,
        "Parent": 0,
        "Scope": 0,
        "State": "Executing",
        "Run Mode": "Normal",
        "BG": false,
        "Out Pipe": "out",
        "Err Pipe": "err",
        "Command": "fid-list",
        "Parameters": ""
    },
    {
        "FID": 265541,
        "Parent": 0,
        "Scope": 0,
        "State": "Executing",
        "Run Mode": "Normal",
        "BG": false,
        "Out Pipe": "out",
        "Err Pipe": "err",
        "Command": "pretty",
        "Parameters": ""
    }
]

File reference

Some of the JSON dumps produced from runtime will include a map called FileRef. This is a trace of the source file that defined it. It is used by Murex to help provide meaningful errors (eg with line and character positions) however it is also useful for manually debugging user-defined properties such as which module or script defined an autocomplete schema.

Debug mode

When debug is enabled garbage collection is disabled for variables and FIDs. This means the output of runtime --variables and runtime --fids will contain more than just the currently defined variables and running functions.

Synonyms

See Also


This document was generated from builtins/core/runtime/runtime_doc.yaml.

This site's content is rebuilt automatically from murex's source code after each merge to the master branch. Downloadable murex binaries are also built with the website.

Last built on Tue Dec 10 22:56:57 UTC 2024 against commit 60f05a260f05a227caf73dd5b3478e3cb3f4bb24e46745b.

Current version is 6.4.1005 (develop) which has been verified against tests cases.