Skip to content

Conversation

@a-pichler
Copy link

Implemented interface speed for windows, linux, darwin, and freebsd as discussed here #465

Windows is self-explanatory since the speed data was already in mibIfRow2

Linux reads the speed directly out of the /sys/class/net files for each interface

Darwin and Freebsd call ifconfig and parse the output (since the other data is also obtained by calling netstat and parsing it i figured that would be the best way)

@shirou
Copy link
Owner

shirou commented Jun 18, 2023

Thank you for your contribution and updating PR.

However, when I run on my FreeBSD 12.4, ifconfig returns this value

vtnet1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=6c07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,LRO,VLAN_HWTSO,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether fo:ba:12:34:56
        media: Ethernet 10Gbase-T <full-duplex>
        status: active

Ethernet 10Gbase-T is not match the regex, therefore, the test is failed.

Could you update the PR?

  1. Could you survey any other way to get interface speed other than ifconfig ?
  2. Update regex to match Ethernet 10Gbase-T.
  3. return error if nothing match.

I will check your PR on Windows later. Thank you for your patience.

@Hipska
Copy link

Hipska commented Jan 30, 2024

Any update on this?

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.

3 participants