Repository navigation
Feat(backend, pipeline): pipeline module - #684
Merged
Merged
Conversation
Add pipeline module so Javier can have a look
# Conflicts: # backend/crates/core/src/lib.rs
# Conflicts: # backend/crates/core/src/lib.rs # backend/crates/station/src/main.rs
…oads" -m "- Move pipeline from software-core into station (crates/station/src/pipeline.rs) - Map ToPipeline variants (connections, protections, board messages, problems, order outcomes) to payload types and publish immediately via BrokerClient - Aggregate Packet::Data telemetry per packet ID over 100 ms windows (cumulative count, mean cycle_time, per-measurement last and window average) and flush on shutdown - Re-export MeasurementUpdate, MessageKind, MessagePayload, and MessageTimestamp from station::payload - Expose event and pipeline from station::lib so station modules share crate-level imports - Add unit tests for immediate event forwarding, 100 ms data windowing, and UTC calendar timestamp conversion
…ar format as rest of station. Created README
GaziH
marked this pull request as draft
December 3, 2026 16:20
- station README and lib.rs list every module, pipeline included. - main.rs and readme-demo.md: the pipeline stand-in counts telemetry and shows connections, notices and orders; the real pipeline needs the websocket broker, which main does not start yet.
JavierRibaldelRio
marked this pull request as ready for review
December 6, 2026 09:12
…lator - The fixture gets a second board (BCU, data packet 661). - Every flush publishes the whole podData map; an empty window nothing. - Every board disconnected at startup; connections only on change. - pipeline stops when the broker is gone, closing both queues. - Accumulator: non-data ids, clock stepping back, malformed packets.
JavierRibaldelRio
approved these changes
Dec 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
pipelineisstation::pipelineturns whatstation::eventroutes to the front intostation::payloadmodels and publishes them throughstation::websocket::broker::BrokerClient.Packet::Data), aggregated per packet intopodData/updatewith cumulativecount, meancycleTimeand, per measurement,lastand the windowaverage.The design and the topic mapping are documented in
backend/crates/station/src/pipeline/README.md.Changes
station::pipelineEvent::Connected/Event::Disconnected→connection/update(whole map, only on change)Packet::Data(queue ⑨) →podData/update, every 100 msPacket::Protection→protection/updatePacket::Message→message/update(board messages only:originfrom the packet,name= the level's ADJ name)ToPipeline::Notice→backend/message(Info→ info,Warning→ warning,Fatal→ fault,Silentignored)ToPipeline::OrderSent/OrderFailed→backend/message("Order Start sent","Order Start not sent: <reason>")websocket's, notpipeline's.station::event: telemetry on its own queueeventnow feedspipelinethrough two queues, so a slow front can never stall the backend:channels.pipeline(ToPipeline, 1024): everything but telemetry.eventwaits when it is full: nothing there may be lost.channels.pipeline_data(Arc<Notification>, onlyPacket::Data, 8192 ≈ 200 ms at 41 k/s):eventusestry_send. When ⑨ is full it drops the front's copy (loggingalready got it), warns when it starts dropping and reports how many it dropped once ⑨ has room again. A closed ⑨ meanspipelineis gone: fatal, as before.pipelinereads ⑥ before ⑨, so protections and messages never wait behind telemetry, and it ends once both queues are closed. It has no saturation logic of its own.Supporting changes
lib.rs:pub mod pipeline; the module list in the docs.main.rs: the pipeline stand-in reads ⑥ and ⑨ and counts telemetry. The realpipelineneeds thewebsocketbroker, whichmaindoes not start yet.station/README.md,readme-demo.md,event/README.md: updated to match.Testing
pipeline::tests(ADJ fixture with two boards):backend/message(and nothing of the backend's onmessage/update);podData/updatemap on every flush, and nothing for an empty window;event::tests, new: telemetry on ⑨ and everything else on ⑥; a full ⑨ dropping the front's copy without stoppingevent; a closed ⑨ being fatal.manual_event_throughput: about 1,000,000 notifications/s in release, over 20 times the requirement.chimera-sender(7 boards, ~730 packets/s for 15 s):loggingand the pipeline stand-in both got 9,928 packets, nothing dropped, exit code 0 on Ctrl+C.Open points
order/stateOrdersis not published:software_core::model::Packethas no state-orders variant.websocketstill has to send the Fatal notice when the frontend is lost (its TODO).net-tcp) also changesevent(router.rs,event.rs, its tests and README) andmain.rs: whichever merges second resolves the conflicts.