Module fuchsia_inspect::stats

source ·
Expand description

§Inspect stats node.

Stats installs a lazy node (or a node with a snapshot of the current state of things) reporting stats about the Inspect being served by the component (such as size, number of dynamic children, etc) at the root of the hierarchy.

Stats nodes are always at “fuchsia.inspect.Stats”.

§Examples

/* This example shows automatically updated stats */

use fuchsia_inspect::stats::InspectorExt;

let inspector = /* the inspector of your choice */
inspector.record_lazy_stats();  // A lazy node containing stats has been installed
/* This example shows stats which must be manually updated */
use fuchsia_inspect::stats;

let inspector = ...;  // the inspector you want instrumented
let stats = stats::StatsNode::new(&inspector);
/* do stuff to inspector */
/* ... */
stats.update();  // update the stats node
stats.record_data_to(root);  /* consume the stats node and persist the data */

Structs§

  • Contains information about inspect such as size and number of dynamic children.

Traits§

  • InspectorExt provides a method for installing a “fuchsia.inspect.Stats” lazy node at the root of the Inspector’s hierarchy.