arangod/SystemMonitor/AsyncRegistry/PrettyPrinter/README.md
ArangoDB's async registry includes all currently active asynchronous operations and their dependencies.
This python-package includes one package that pretty-prints the async registry inside a gdb debugging session and one script that improves the readability the async registry items coming from a REST call. Both applications print all active async operations in form of stacktraces with one operation per line and use some ascii-art to improve the readability.
When debugging, it can be helful to get an overview of all active async operations at the current execution state. The standard version is almost impossible to read due to the complexity of the registry. To use the async-registry pretty-printer in gdb you need to
.gdbinit file in this directory to gdb at startup, e.g. via:gdb -ix <path to the .gdbinit file in this directory> <executable via --args or pid via -p>
This ensures that the pretty-printer is loaded to gdb. You can check if it is loaded inside gdb with info pretty-print which should include async_registry. Now, whenever you print the global registry arangodb::async_registry::registry, gdb will show you the pretty-print version.
ctest --build -R async_registry_python_pretty_printer_test
cmake --build --target async_registry_gdb_pretty_printer
ctest --build -R async_registry_gdb_pretty_printer_test
use -V option on ctest to see gdb debug output
ArangoDB provides a REST call which gives you all active async operations. The pretty-printer python script improves the readability of the output. Use it as the following:
curl -s <server>/_admin/async-registry -u root: | ./src/pretty-printer.py