tohojo / flent

The FLExible Network Tester.
https://flent.org
Other
431 stars 77 forks source link

Feature Request: Add CPU plot to tests #275

Closed infused-kim closed 1 year ago

infused-kim commented 1 year ago

Hi,

First of all... thank you for creating such an amazing piece of software. It is really helpful.

One thing I am missing though is the ability to plot the CPU load of the router. You can get it by using the option --te=cpu_stats_hosts=root@192.168.2.1.

The results are added to the JSON, but currently there is no way to actually visualize the data.

As a workaround, until this is added to flent, it's possible to edit the test config and add the following to the PLOTS list:

PLOTS = o([
    ('cpu',
     {'description': 'CPU plot',
      'type': 'timeseries',
      'legend_title': 'CPU Load',
      'axis_labels': ['CPU Load'],
      'series': [
                 {'data': glob('cpu_stats_*'),
                  'label': ''}
                ]}),

    ('download',
     {'description': 'Download bandwidth plot',
      'type': 'timeseries',
      'legend_title': 'TCP download',
      'series': [{'data': 'TCP download BE',
                  'label': 'BE'},
                 {'data': 'TCP download BK',
                  'label': 'BK'},
                 {'data': 'TCP download CS5',
                  'label': 'CS5'},
                 {'data': 'TCP download EF',
                  'label': 'EF'},
                 {'data': 'TCP download avg',
                  'label': 'Avg',
                  'smoothing': 10,

                  'color': 'black',
                  'linewidth': 2}]}),
[...]

And then run it with:

flent -i rrul-2022-10-19T093407.952309.flent -p cpu -o cpu-plot.png

This will output a plot like this: cpu-plot

tohojo commented 1 year ago

That 'cpu' plot should already appear when you load a file with the cpu stats included. Could you please share the data file where this doesn't work? Also, how are you looking at the plots (GUI, command line plots, etc)?

infused-kim commented 1 year ago

I am using the command line and non of the plots in —list-plots showed a cpu option.

Or did I miss it somewhere?

Unfortunately, I can’t run the gui as qt5 is not supported on apple silicon macs.

I’ll upload the Flent file tomorrow when I’m back at my computer.

infused-kim commented 1 year ago

I have set up a ubuntu VM and installed flent with the flent-gui working in there. And indeed, I am able to generate the cpu plots in there.

But how can the same plots be generated from the command line? They don't show up when running flent rrul --list-plots.

infused-kim commented 1 year ago

Ok, I have figured it out... The following plots are available: cpu, cpu_box, cpu_bar, cpu_box_combine, cpu_bar_combine

Thank you @tohojo!

tohojo commented 1 year ago

Cool! You're welcome! :)

dtaht commented 1 year ago

Please post plots of your work to the world. We really care that we get feedback like yours... and care more, when flent turns out useful for something. The comparison plot features are to die for.