From 652c9b7d11dd7b708ac37df1caecbc46467b6b2b Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 18 Mar 2024 19:09:30 -0400 Subject: [PATCH] add streamed events to visualization (#337) --- figures/vis/vis-collector-component.puml | 26 ++++++++++++++++++++++++ figures/vis/vis-collector-component.svg | 1 + visualization-design.typ | 11 ++++++++++ 3 files changed, 38 insertions(+) create mode 100644 figures/vis/vis-collector-component.puml create mode 100644 figures/vis/vis-collector-component.svg diff --git a/figures/vis/vis-collector-component.puml b/figures/vis/vis-collector-component.puml new file mode 100644 index 0000000..885b3a2 --- /dev/null +++ b/figures/vis/vis-collector-component.puml @@ -0,0 +1,26 @@ +@startuml + +package ott_collector { + component ServiceDiscovery + component Collector + component EventBus + + component Rocket { + database SystemState + } +} + +package ott_balancer +package ott_vis_datasource + +ServiceDiscovery --> Collector: Informs +ServiceDiscovery ..> ott_balancer: Discovers +Collector --> SystemState: Builds +Collector --> ott_balancer: Polls +Collector --> EventBus: Feeds +EventBus <-- Rocket: Uses to serve /state/stream +Rocket --> SystemState: Uses to serve /state +ott_vis_datasource ..> SystemState: Polls for +ott_vis_datasource ..> EventBus: Streams from + +@enduml diff --git a/figures/vis/vis-collector-component.svg b/figures/vis/vis-collector-component.svg new file mode 100644 index 0000000..6ee6e62 --- /dev/null +++ b/figures/vis/vis-collector-component.svg @@ -0,0 +1 @@ +ott_collectorRocketServiceDiscoveryCollectorEventBusSystemStateott_balancerott_vis_datasourceInformsDiscoversBuildsPollsFeedsUses to serve /state/streamUses to serve /statePolls forStreams from \ No newline at end of file diff --git a/visualization-design.typ b/visualization-design.typ index f129a84..183a48f 100644 --- a/visualization-design.typ +++ b/visualization-design.typ @@ -258,3 +258,14 @@ The custom panel will be structured as shown in @Figure::panel-internal-class. I image("figures/vis/panel-internal-class.svg", height: 80%), caption: "Class diagram of the custom Grafana panel, showing it's internal structure." ) + +== Streamed Events + +The visualization will be able to recieve streamed events from the balancers for realtime updates of the visualization. The collector is responsible for recieving these events and passing them to the datasource via websockets. The panel will then update the visualization accordingly. @Figure::vis-collector-component shows how the collector interacts with the visualization. + +#figure( + image("figures/vis/vis-collector-component.svg"), + caption: [Component diagram showing the internal components of the collector and how they interact with the rest of the system.] +) + +In the Balancer, events are sourced directly from the Balancer's logs via a `Layer` from the `tracing` crate.