Skip to content

feat: estimate offloaded throughput on the API dashboards - #40

Merged
tbortolossi merged 1 commit into
mainfrom
feat/api-offload-estimate
Sep 26, 2026
Merged

tbortolossi merged 1 commit into
mainfrom
feat/api-offload-estimate

Conversation

@tbortolossi

Copy link
Copy Markdown
Owner

Problem

The API dashboards show the total throughput from the MAC-level port counters since v1.4.5, but nothing shows how much of it is hardware-offloaded. During the PA-5580 load test the dataplane ibytes read ~47 Gb/s and the port counters ~97 Gb/s; the difference was the offloaded UDP.

Solution

  • Collector: keep ibytes/obytes of each physical port as dp_in_octets/dp_out_octets, only when the matching port/rx-bytes/port/tx-bytes exist (no fake "0 offload" on platforms without the port block). Existing fields are unchanged.
  • API and API Chassis dashboards: new Throughput Received: Dataplane vs Offloaded panel in the general section (full width, under the throughput / link-load row): Dataplane + Offloaded (estimate) stacked, Total as an unstacked line.
  • Offloaded = port − dataplane, over windows of at least 2 minutes, taking the smaller of the current and previous window, floored at 5% of the total.

Why the smoothing

On the PA-440 (no offload hardware) the port counter is refreshed late and in bursts: 20 s differences swung by up to ±12 Mb/s, and 2-minute windows still read +11.6% and +27.6%. A late refresh reads negative then positive in consecutive windows, real offload stays positive, so min(current, previous) removes it. Trade-off: offload onset shows one window late.

Testing

  • 283 unit tests pass; new tests for the collector fields (real 5580 XML shape) and the panel query.
  • Live stack: Telegraf rebuilt, dp_* fields written for the 3 physical ports only; panel query through Grafana /api/ds/query returns Dataplane / Offloaded / Total, offloaded 0 on the PA-440.
  • Synthetic Flux check: steady 97/47 → 49–50 offloaded; the PA-440 lag pattern → 0.

Not covered

  • SNMP dashboards: no dataplane byte counter in the PAN MIBs, unchanged.
  • Chassis (PA-7000/7500) not verified on hardware; if the port block is missing the panel shows no data.

Deploy

Rerun ./generate.sh to rebuild the Telegraf image.

🤖 Generated with Claude Code

The API collector now keeps the dataplane ibytes/obytes of each physical
port as dp_in_octets/dp_out_octets, next to the MAC-level port counters
(only when the port block exists, so a missing port counter never reads
as zero offload). The general section of both API dashboards gains a
"Throughput Received: Dataplane vs Offloaded" panel: dataplane and
offloaded (port minus dataplane) stacked, plus the total line.

Small platforms refresh the port counters late and in bursts: on a
PA-440 without offload, 20 s differences swung by several Mb/s both ways
and 2-minute windows still read up to +27%. A burst reads negative then
positive in consecutive windows, while real offload stays positive, so
the estimate takes the smaller of two consecutive window differences,
over windows of at least 2 minutes, floored at 5% of the total.

SNMP exposes no dataplane byte counter, so the SNMP dashboards are
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@tbortolossi
tbortolossi merged commit 8d7f925 into main Sep 26, 2026
5 checks passed
@tbortolossi
tbortolossi deleted the feat/api-offload-estimate branch September 26, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant