Skip to content

Distinguish maximum average and peak traffic on existing and new graphs - #8169

Draft
alcatron wants to merge 1 commit into
Cacti:1.2.xfrom
alcatron:fix/interface-traffic-peak-legends
Draft

alcatron wants to merge 1 commit into
Cacti:1.2.xfrom
alcatron:fix/interface-traffic-peak-legends

Conversation

@alcatron

@alcatron alcatron commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The standard interface traffic templates draw MAX traffic lines alongside averaged traffic, but the legend’s “Maximum” reports the highest averaged value. This can make a visible spike appear inconsistent with the legend.

This renames that statistic to “Max average:” and adds “Max peak:” directly underneath it for each direction, with aligned labels and values. The new reading follows the corresponding MAX series. Bits/sec, bytes/sec, bandwidth-total and 95th percentile variants are covered; existing totals, units and percentile definitions are preserved.

Existing graphs are included: the upgrade identifies the five stock templates by stable hashes, updates their linked graph items and adds the template input associations needed by future graphs. The same migration runs after installation package imports, leaving the signed packages intact. Running it again does not add duplicate peak readings. Layouts that no longer match the stock legend are left unchanged.

I tested the layout on 69 traffic graphs on my test setup and checked the rendered daily and weekly views. An isolated migration regression check passed for all five upstream template definitions and five existing graph copies using different database IDs, including preservation of calculations, template/input linkage and repeat execution. PHP syntax checks passed. The automated migration has not yet been tested against a separate full database upgrade.

The migration is connected to the 1.2.32 upgrade hook and installation package imports. This change does not depend on the two-year panel change.

@alcatron
alcatron marked this pull request as ready for review October 3, 2026 20:50
@TheWitness

Copy link
Copy Markdown
Member

I'm going to have to stew on this one. It's a mass change in the middle of the game. May have negative impact on the community. I'll give it some thought next week. In the mean time, you can fix the issues from the previous pull which is much more benign.

@alcatron

alcatron commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

That’s fair, I understand the concern about changing existing graphs and templates across the community.

For context, I’ve been running Cacti in an enterprise environment for a long time, and this has been a recurring source of confusion for management and other users. They see the inbound/outbound peaks on the graph and naturally expect the “Maximum” values underneath to match. I’ve regularly had to explain that the existing Maximum represents the maximum of the averaged series, while these templates also display a MAX consolidation series.

My aim is to make that distinction clear within the graph itself, particularly when it’s exported, screenshotted or included in a report without someone there to explain it.

I’m happy to discuss a less disruptive approach, including making the changes opt-in rather than automatically updating existing graphs.

@alcatron

alcatron commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author
image Here’s an example from my environment showing how this looks with the proposed changes applied. The inbound traffic visibly peaks at around 696 Mbps, while the maximum of the averaged series is only 48.89 Mbps. Outbound similarly has a maximum average of 137.12 Mbps while the actual displayed peak reaches 321.59 Mbps.

With the legend showing both Max average and Max peak, the values underneath now correspond clearly to what someone can see in the graph. Without that distinction, someone viewing the graph in isolation could reasonably wonder why the value labelled “Maximum” is substantially lower than the traffic peak they can see.

@github-actions
github-actions Bot force-pushed the fix/interface-traffic-peak-legends branch 7 times, most recently from e63f128 to 830eaf0 Compare October 8, 2026 08:57
@github-actions
github-actions Bot force-pushed the fix/interface-traffic-peak-legends branch from 830eaf0 to 50e01b8 Compare October 8, 2026 20:50
@TheWitness
TheWitness marked this pull request as draft October 9, 2026 00:38

This branch has not been deployed

No deployments
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.

2 participants