Skip to content

Add display history REST API - #3144

Open
suppenkasper0815 wants to merge 2 commits into
tbnobody:masterfrom
suppenkasper0815:feature/engineering
Open

Add display history REST API#3144
suppenkasper0815 wants to merge 2 commits into
tbnobody:masterfrom
suppenkasper0815:feature/engineering

Conversation

@suppenkasper0815

Copy link
Copy Markdown

Summary

  • add a new REST endpoint for display history values
  • expose the stored diagram datapoints through the JSON API

Review notes

  • Race conditions: addressed by guarding the diagram state with a mutex for both background sampling and API/rendering access.
  • Thread safety: the shared graph buffer is now read under the same lock as the writer tasks.
  • Const correctness: getters now return snapshots instead of exposing mutable state directly.
  • Memory usage: the change keeps the existing fixed-size buffer and adds only a small mutex and a copied snapshot for the API path.
  • JSON size: the payload contains only the current values array plus metadata, with no extra per-entry overhead.
  • OOM risk: no dynamic allocations were introduced in the new request path; the response uses the existing fixed-size array.
  • AsyncWebServer conformity: the handler follows the existing AsyncWebServer pattern and uses the shared JSON response helper.
  • Code style: the implementation matches the surrounding project conventions.

Verification

  • Full build: pio run

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