Edge AI Add-on API 3.0.0
Loading...
Searching...
No Matches
nrf_edgeai_obsv_metric_snapshot_t Struct Reference

Read-only view over one metric's accumulated counters. More...

#include <nrf_edgeai_obsv_metrics.h>

Data Fields

uint32_t metric_id
 On-wire metric identifier.
 
uint32_t version
 Metric payload version.
 
uint16_t num_rows
 Number of rows in the counter matrix.
 
uint16_t num_cols
 Number of columns in the counter matrix.
 
const uint32_t * counts
 Row-major counter matrix, num_rows x num_cols uint32s.
 
uint16_t config_rows
 Number of rows in the config matrix (0 = no configuration reported).
 
uint16_t config_cols
 Number of columns in the config matrix.
 
const int32_t * config
 Row-major config matrix, config_rows x config_cols int32s.
 

Detailed Description

Read-only view over one metric's accumulated counters.

Produced by nrf_edgeai_obsv_metric_t::snapshot() and consumed by transport layers (e.g. the Memfault CDR glue) to encode counters into whatever wire format the transport chooses. counts points directly into the metric's priv storage and remains valid for the lifetime of the metric instance.

Counters are a row-major 2-D uint32_t matrix of num_rows x num_cols elements. Metrics with 1-D data set num_cols to 1.

A metric may also report the configuration its counters were gathered with (e.g. histogram ceilings) as a second row-major int32_t matrix of config_rows x config_cols elements at config. The meaning and order of the values is fixed per (metric_id, version). The core zero-initializes the snapshot before calling snapshot(), so a metric with no configuration leaves config NULL and nothing is emitted for it.

Thread safety: snapshot() is not synchronized against concurrent nrf_edgeai_obsv_core_update_probs() calls. Callers must ensure update() does not overlap snapshot() (e.g. hold the context lock for the duration of for_each_metric() or encode()).


The documentation for this struct was generated from the following file: