Expand description

Diagnostics hierarchy

This library provides a tree strcture used to store diagnostics data such as inspect and logs, as well as utilities for reading from it, serializing and deserializing it and testing it.


Macro utilities for building a DiagnosticsHierarchy.
Inspect Format
Testing utilities for a DiagnosticsHierarchy.


Macro to simplify tree matching in tests. The first argument is the actual tree passed as a DiagnosticsHierarchyGetter (e.g. a DiagnosticsHierarchy or an Inspector). The second argument is given to tree_assertion! which creates a TreeAssertion to validate the tree.
Macro to check a hierarchy with a nice JSON diff. The syntax of the expected value is the same as that of hierarchy!, and essentially the same as assert_data_tree!, except that partial tree matching is not supported (i.e. the keyword contains).
This macro simplifies creating diagnostics hierarchies, to remove the need of writing multiple nested hierarchies and manually writing all properties.
Macro to simplify creating TreeAssertions. Commonly used indirectly through the second parameter of assert_data_tree!. See assert_data_tree! for more usage examples.


A bucket of a histogram property.
A hierarchy of nodes representing structured data, such as Inspect or structured log data.
The parameters of an exponential histogram.
The parameters of a linear histogram.
A value that couldn’t be loaded in the hierarchy and the reason.


Represents the content of a DiagnosticsHierarchy array property: a regular array or a linear/exponential histogram.
Format in which the array will be read.
Errors that can happen in this library.
Reasons why the value couldn’t be loaded.
A named property. Each of the fields consists of (name, value).


Extra slots for an exponential histogram: 3 parameter slots (floor, initial step and step multiplier) and 2 overflow slots.
Extra slots for a linear histogram: 2 parameter slots (floor, step size) and 2 overflow slots.


Filters a diagnostics hierarchy using a set of path selectors and their associated property selectors.
Applies a single selector to a DiagnosticsHierarchy, returning a vector of tuples for every property in the hierarchy matched by the selector.