Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

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

Open
bhagathkrishnacdac wants to merge 3 commits into
omec-project:mainfrom
bhagathkrishnacdac:bess-congnitive-complexity
Open

bhagathkrishnacdac wants to merge 3 commits into
omec-project:mainfrom
bhagathkrishnacdac:bess-congnitive-complexity

Conversation

@bhagathkrishnacdac

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants