Working with Kanzi Monitor services¶
Kanzi Monitor is a plugin that runs inside your Kanzi application. Its work is split into services: each service addresses one task, runs in the application’s process, and can be enabled or disabled independently in the Kanzi Monitor configuration file.
The tools that connect to a running application from outside, the console clients, the Monitor Web UI and the MCP server, are described in Working with Kanzi Monitor tools.
How the services fit together¶
The services differ in what they do to the application. Each step down this list has a larger effect on the running application, so each one has its own configuration key:
Observe: read and record anything, and change nothing. The Overwatch service reports, and the diagnostic services record.
Change values: set property values and data, and dispatch messages. The Overwatch service does this behind
OverwatchPropertyChangeEnabled.Change structure: create, move, detach and destroy nodes, and add node components. The NodeTree service.
Create content: make resources that the kzb does not contain. The Resource service.
Service |
Configuration key |
Commands |
Level |
|---|---|---|---|
Command Processor |
|
The consoles, and the core commands such as |
Carries every service’s commands |
Overwatch |
|
|
Observe, change values |
Performance |
|
|
Observe |
Profiling Trace |
|
|
Observe |
Log |
|
|
Observe |
UI |
|
|
Observe |
Capture |
|
|
Observe |
Debug |
|
|
Observe; a breakpoint can stop the application or run a command |
NodeTree |
|
|
Change structure |
Resource |
|
|
Create content |
Every service that names a node or a resource uses the same handles. A handle such as @48213977 names one object, whichever service gave it out, so a node that nodetree.create returns can be inspected with overwatch.props and a resource that resource.create returns appears in overwatch.allresources under the same handle.
Where a command lives¶
overwatch.*is where the reporting commands are, for the Overwatch service and for the diagnostic services: the trace, log and watcher commands areoverwatch.*commands, next to the services’ own console commands.A service that changes the application’s structure or creates content has its own command prefix and its own configuration key, so that you can switch it off and keep everything else. That is why the NodeTree service has
nodetree.*and the Resource service hasresource.*.overwatch.dispatchmessageruns application logic, which can do more than one property write. It is still a change of values, not of structure, so it is behindOverwatchPropertyChangeEnabledwithoverwatch.setprop, and every dispatch is written to the application log. See Dispatching a message.Resources have commands in two places, divided by whose resources they are.
resource.*creates, holds and destroys the resources that Kanzi Monitor creates. Theoverwatch.*resource commands work on the application’s own resource manager and the resources it loads:overwatch.acquireresourceandoverwatch.unregisterresourceload and let go of a resource by URL, andoverwatch.setmemorystrategyandoverwatch.resourcedirectorychange the resource manager’s settings. See Forcing a resource into existence, and letting go of one.
NodeTree and node tree¶
The words have two meanings in Kanzi Monitor:
The NodeTree service, with its
nodetree.*commands, changes the structure of the application’s nodes.A node tree is one of the application’s
Screennodes with the nodes below it. An application with several views, such as a service-hosted application, has several.nodetreeinfolists them, and the optionalnodetreeargument ofuiselects one by its index.
Profiling Trace Service¶
Collects runtime profiling data from the Kanzi Engine and writes it to a JSON trace file compatible with the Perfetto trace viewer. Use this service to analyze frame timing, rendering stages, and engine operations.
Command Processor Service¶
Provides a command-line interface for interacting with the Kanzi Engine at runtime. You can send commands through a local terminal, a remote TCP connection, or a serial port (UART).
See Using the Command Processor service, and Console protocol v1 for the wire contract if you are writing a client.
UI Service¶
Renders graphical overlays on top of the regular Kanzi application content to display runtime information and help identify rendering issues. Other services, such as the Log service, can also register their own overlay screens.
Log Service¶
Captures Kanzi Engine log messages into an in-memory ring buffer. You can view log entries through the console, on-screen overlay, or as part of a profiling trace.
Performance Service¶
Continuously measures runtime performance metrics such as frame rate, frame timing, and rendering statistics. These metrics are exported as counter tracks in the Perfetto trace viewer.
Overwatch Service¶
Provides JSON-based remote introspection of a running Kanzi application.
Exposes the scene graph, node properties, resources, textures, performance metrics, and more through a set of overwatch.* commands.
Capture Service¶
Records a bounded sequence of screen frames into memory as a keep-last-N ring, so you can stop after something interesting happens and replay the frames that led up to it. Frames are fetched afterwards with per-frame metadata, and the service reports what the recording costs in framerate.
Debug Service¶
Break, log, capture a screenshot, or run a console command when a node property reaches a value. The condition is evaluated inside the assignment that changed the property, so with a debugger attached execution stops on the code that wrote the value rather than a frame later.
NodeTree Service¶
Changes the structure of the running application’s node tree: create a node by metaclass or from a prefab, any number of times, anywhere in the tree; destroy, detach, reattach and move any node; and add node components. Builds test scenes the project does not contain.
Resource Service¶
Creates resources in the running application, keeps them alive and destroys them: any concrete resource class, set up with property values and registered under a URL, and font families with faces and fallbacks. With the NodeTree service, it builds content the kzb does not contain.
See Using the Resource service