Visualizations

This module provides functions for visualizing the network graph and latency heatmap of ChaskiNode objects. It uses networkx and matplotlib to render the network graph, which displays nodes, connections, and latency values. A heatmap of latencies between nodes is created using seaborn to help in identifying patterns and high-latency connections.

chaski.utils.viz.display_graph(nodes: List[ChaskiNode], layout=networkx.circular_layout, show_latencies=False) None[source]

Display the network graph and latency statistics.

Parameters:

nodes (List[Node]) – A list of nodes, each containing name and server pairs.

chaski.utils.viz.display_heatmap(nodes: List[ChaskiNode], show=True) None[source]

Display a heatmap of latencies between nodes.

Parameters:

nodes (List[Node]) – A list of Node objects, each containing server pairs with latency information.

Return type:

None

chaski.utils.viz.display_subscriptions_graph(nodes: List[ChaskiNode], layout=networkx.spring_layout, show_latencies=False, chain='_CHAIN_') None[source]

Display the network graph and latency statistics.

Parameters:

nodes (List[Node]) – A list of nodes, each containing name and server pairs.