Skip to content

ZeroDivisionError in python-sarviz/sar/viz.py #2

Description

@nicolas-raoul

python-sarviz's demo.py crashes on any of my sar files:

Traceback (most recent call last):
  File "demo.py", line 30, in <module>
    main(sys.argv[1], sys.argv[2])
  File "demo.py", line 15, in main
    sar_viz = viz.Visualization(insar.get_sar_info(), paging=True, network=True, disk=True)
  File "/home/nico/src/python-sarviz/sar/viz.py", line 78, in __init__
    self._preprocess_sar_data()
  File "/home/nico/src/python-sarviz/sar/viz.py", line 114, in _preprocess_sar_data
    self.xticks = np.arange(0, tp_count, xtick_label_stepsize)
ZeroDivisionError: division by zero

Debugging shows that both tp_count and xtick_label_stepsize have a value of 0. Setting the parameters of viz.Visualization to false does not solve the problem.

By the way, here is the result of sar -A -f /var/log/sysstat/sa11 (my goal is to have graphs for as many variables as possible):

sar.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions