louwrentius / fio-plot

Create charts from FIO storage benchmark tool output
BSD 3-Clause "New" or "Revised" License
370 stars 87 forks source link

TypeError: object of type 'NoneType' has no len() #39

Closed rubin55 closed 4 years ago

rubin55 commented 4 years ago

When creating a histogram exactly according to the example command line in README.md (i.e, fio_plot -i something/4k/ -T "Title" -H -r randread -d 1 -n 1), I get the following error:

Traceback (most recent call last):
  File "//home/rubin/Syncthing/Source/Other/fio-plot/fio_plot/fio_plot", line 262, in <module>
    main()
  File "//home/rubin/Syncthing/Source/Other/fio-plot/fio_plot/fio_plot", line 250, in main
    uses_json_files[item]['function'](settings, parsed_data)
  File "/mnt/s/Source/Other/fio-plot/fio_plot/fiolib/barhistogram.py", line 120, in chart_latency_histogram
    sourcelength = len(settings['source'])
TypeError: object of type 'NoneType' has no len()
rubin55 commented 4 years ago

probably a missing if settings['source']:

yeah that's it, in barhistogram.py, line 120, source is used without checking if specified/existing in settings.

louwrentius commented 4 years ago

Whoops, I already see the bug. If you add -s with some text as argument it will work, I think.

On 27 Oct 2020, at 15:11, Rubin Simons notifications@github.com wrote:

 probably a missing if settings['source']:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

louwrentius commented 4 years ago

It was exactly as you predicted.

I've just pushed some fixes to master. I'm closing this issue but if you believe something is still wrong, feel free to reopen it.