Skip to content

refactor: decompose _draw_pipeline and isolate metric-formatting calculations - #183

Open
bhagathkrishnacdac wants to merge 1 commit into
omec-project:mainfrom
bhagathkrishnacdac:bess-congnitive-complexity
Open

refactor: decompose _draw_pipeline and isolate metric-formatting calculations#183
bhagathkrishnacdac wants to merge 1 commit into
omec-project:mainfrom
bhagathkrishnacdac:bess-congnitive-complexity

Conversation

@bhagathkrishnacdac

Copy link
Copy Markdown

Description
This PR refactors _draw_pipeline to address cognitive complexity and improve code readability. The logic that formats Graphviz descriptions and evaluates rate differentials for real-time monitoring has been separated from the subprocess execution and IPC stream pipeline.

Key Changes

  • Isolated Label Generation: Extracted _get_node_labels to manage the assembly of multi-line module descriptors (names, classes, descriptions).
  • Decoupled Metric Evaluations: Extracted _get_gate_label to calculate either static counts or active rate differentials (Megabits/packet metrics) and return standard string formats.
  • Simplified Process Piping: Streamlined the main _draw_pipeline function to focus strictly on spawning graph-easy via subprocess.Popen and streaming the pre-calculated node and edge configurations to standard input.

…ulations

Signed-off-by: bhagathkrishnacdac <bhagath.krishna@cdac.in>
@bhagathkrishnacdac
bhagathkrishnacdac requested a review from a team August 2, 2026 17:59
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