# feat\(netflow-db\): store packet\- and byte-weighted MAAD measures · flambo/atlantis

[View on GitCafe](https://git.cafe/flambo/atlantis/commit/b987c2d57c9927dd37313492d6abc1ad4296488b)

Repository: [flambo/atlantis](https://git.cafe/flambo/atlantis)

Visibility: public

Requested revision: b987c2d57c9927dd37313492d6abc1ad4296488b

Requested commit: b987c2d57c9927dd37313492d6abc1ad4296488b

Commit: b987c2d57c9927dd37313492d6abc1ad4296488b

Tree: 83b5ad73f8ce14800831586e9cf28ba5d4da2c8b

Author: flamboh

Committer: flamboh

## Message

```
feat(netflow-db): store packet- and byte-weighted MAAD measures

Scope accumulation keeps summed packets and bytes per unique address
instead of a bare address set. Rollups merge children by summing, so
per-address totals stay additive. Counters are stored unaligned, so each
entry grows by exactly 16 bytes.

Every MAAD computation now runs three measures for IPv4 and IPv6 at every
granularity: addresses (structure, spectrum, dimensions, unchanged),
packets and bytes (structure and dimensions only). A weighted measure
excludes addresses whose counter sums to 0, records the count as
zeroWeightAddrs in the row metadata and logs it.

address_structure_stats gains a measure key column with a CHECK that
limits spectrum rows to addresses. The table, product schema, pipeline
contract, result config and MAAD contract versions bump, and the measure
set joins the product identity, so a fresh product database is required.
Compare, export, verify and the web-verify queries key on or filter by
measure, and verify --require-maad-data checks that every measure is
present.

```

## Parents

- [b7aff01ad8acc14e1a927e3961e42e320c2c34b7](https://git.cafe/flambo/atlantis/commit/b7aff01ad8acc14e1a927e3961e42e320c2c34b7?format=markdown)

[Source at this commit](https://git.cafe/flambo/atlantis/tree/b987c2d57c9927dd37313492d6abc1ad4296488b?format=markdown)
