tohojo / flent

The FLExible Network Tester.
https://flent.org
Other
428 stars 79 forks source link

Add ethtool monitoring support to Flent #302

Open freysteinn opened 3 months ago

freysteinn commented 3 months ago

This commit adds ethtool monitoring to Flent. The "common.inc" file includes this capability in most Flent tests. The ethtool support adds three new test parameters: "ethtool_hosts", "ethtool_devices", and "ethtool_fields". Behind the scenes, Flent runs the "ethtool -S command on all devices that support it via SSH.

A breakdown of these new parameters is as follows:

Example: ethtool_devices=eth0,eth1 ethtool_fields=tx_packets_phy,rx_packets_phy,eth2:rx_bytes

In this example, the fields "tx_packets_phy" and "rx_packets_phy" will be monitored on eth0 and eth1; however, only field rx_bytes will be monitored on eth2.

One limitation of this version of the ethtool capability is that all hosts will share the same values of devices and fields. We could handle this by adding a character different from a comma to separate the values. However, that would not fit how the rest of the global *_hosts parameters work, and it could be more challenging to deal with in the batch file.

freysteinn commented 3 months ago

I added that it shows the value per second by default. However, there are cases where you would want to see incremental changes instead of a delta calculated into values per second. Originally, I had the option of setting a delta or incremental as a parameter using the values 'i' and 'd': "ethtool_fields=tx_bytes:i,eth0:rx_packets:d,eth1:tx_packets:d". Maybe that's still worth having?