How mansourm61/netperftester works
Main Components
• Main Application (Controller):
• NetPerfTester.py – the entry point that ties together the GUI, process management, and data handling.
• GUI Layer:
• Built with Python’s tkinter (as indicated in the README) and includes elements such as the bandwidth gauge widget, log display, and other interactive components.
• Helper/Supporting Modules:
• ModuleMeter.py – likely supports the meter widgets for visualizing network performance metrics.
• OS-Dependent Utilities:
• Executable scripts in the “bin” folder (KillPortProcessLinux.sh and KillPortProcessWindows.bat) – these scripts handle terminating processes that are interfering with port usage.
• Measurement Handling:
• “measurements” directory – although not detailed, it appears to contain logs or supplementary data for performance tests, as evidenced by its own README file.
Relationships and Interactions
• User Interaction: The user launches the application and interacts with the GUI.
• GUI to Controller: User inputs trigger events in NetPerfTester.py, which interacts with the underlying logic.
• Controller to External Tools: Depending on the OS, the application calls the installed iperf (as well as the provided kill scripts) using system calls (via the subprocess module). Note that the GUI does not directly interact with iperf outputs; instead, it handles file-based outputs due to buffering issues.
• Data Flow: After running iperf, the generated output is written to a temporary file. The controller then reads this file, parses the performance metrics (Transfer Bytes, Bandwidth, Jitter, PER), and updates the GUI accordingly.
• Logging/Measurement: Results are logged into CSV files for record-keeping, and the “measurements” directory potentially stores or organizes this historical data.
• Helper Modules interact with both the GUI (for dynamic visual updates) and possibly debugging/logging output.
Architectural Patterns and Important Design Principles
• OS-Awareness: The design accommodates cross-OS compatibility by using specific scripts and mechanisms tailored for Windows and Linux.
• Loose Coupling via File I/O: Because direct stdout handling wasn’t fully reliable, the application uses file-based communication to decouple iperf’s output generation from its analysis, which enables a clearer separation of concerns.
• Reusability: The use of external modules (e.g., the bandwidth gauge widget from an external source) demonstrates how the application leverages reusability and external libraries.