Skip to content

Net stat feature#20

Merged
navidpadid merged 3 commits intomainfrom
net-stat
Feb 14, 2026
Merged

Net stat feature#20
navidpadid merged 3 commits intomainfrom
net-stat

Conversation

@navidpadid
Copy link
Owner

This pull request adds a new per-process network statistics section to the output, providing a brief summary of socket usage and TCP network counters, and updates documentation and tests accordingly. The main changes include collecting and displaying aggregated network stats, tracking per-interface socket usage, and ensuring robust test coverage for the new functionality.

New network statistics feature:

  • Adds a [network] section to the process output, showing total sockets, breakdown by protocol (TCP/UDP/UNIX), TCP packet and byte counters, retransmits, drops, and per-interface socket counts. (src/elf_det.c [1] [2]
  • Introduces the struct netdev_count and related helpers for tracking and displaying socket counts per network device/interface. (src/elf_det.h [1] [2]

Documentation updates:

  • Documents the new network stats section, its fields, and limitations in both the user-facing (README.md) and technical documentation (docs/TECHNICAL.md). (README.md [1] [2]; docs/TECHNICAL.md [3] [4]
  • Adds guidance and expectations for testing the network stats output in the testing documentation. (docs/TESTING.md [1] [2]

Testing improvements:

  • Expands end-to-end tests to check for the presence and correctness of the [network] section and its key fields in the output for various processes. (e2e/qemu-test.sh [1] [2] [3]
  • Adds unit tests for the add_netdev_count helper to ensure correct aggregation and boundary handling. (src/elf_det_tests.c src/elf_det_tests.cR500-R540)

Miscellaneous:

  • Updates includes and definitions to support the new functionality (e.g., network device structures, interface name sizing). (src/elf_det.c [1] src/elf_det.h [2]

These changes collectively provide users with a concise overview of a process's network activity and resource usage, and improve observability and testability for the new feature.

@navidpadid navidpadid merged commit eedd0fb into main Feb 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant