pombreda / pybootchartgui

Automatically exported from code.google.com/p/pybootchartgui
GNU General Public License v3.0
0 stars 0 forks source link

Receiving "ZeroDivisionError: float division #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by bismar...@gmail.com on 29 Jul 2009 at 10:23

GoogleCodeExporter commented 9 years ago
Sorry, for some reason I accidentally submitted the ticket without completing 
it.

I am receiving the following error when I try to create the graphical output:

Traceback (most recent call last):
  File "/usr/bin/bootchart", line 7, in <module>
    sys.exit(main())
  File "/usr/lib/python2.6/site-packages/pybootchartgui/main.py", line 102, in main
    render()
  File "/usr/lib/python2.6/site-packages/pybootchartgui/main.py", line 93, in render
    batch.render(writer, res, options.format, filename)
  File "/usr/lib/python2.6/site-packages/pybootchartgui/batch.py", line 24, in render
    draw.render(ctx, *res)
  File "/usr/lib/python2.6/site-packages/pybootchartgui/draw.py", line 237, in render
    draw_chart(ctx, IO_COLOR, True, chart_rect, [(sample.time, sample.util) for 
sample in disk_stats], proc_tree)
  File "/usr/lib/python2.6/site-packages/pybootchartgui/draw.py", line 167, in 
draw_chart
    yscale = float(chart_bounds[3]) / max(y for (x,y) in data)
ZeroDivisionError: float division
/usr/bin/bootchart -q -f png -o /var/log/bootchart-20360207-0454.png /var/log: 
No 
such file or directory

I have attached my bootchart.tgz file for comparison.

Original comment by bismar...@gmail.com on 29 Jul 2009 at 10:25

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for the report. The proc_diskstats.log file in your bootchart.tgz has 
the line

bootchartd not running

which makes pybootchartgui choke. In the most recent version it should say

biehl@salt:~/workspaces/testworkspace/pybootchartgui$ python pybootchartgui.py 
bootchart.issue.13.tgz 
parsing 'bootchart.issue.13.tgz'
parsing 'header'
parsing 'proc_diskstats.log'
Parse error: expected a timed-block, but timestamp 'bootchartd not running' is 
not an
integer
biehl@salt:~/workspaces/testworkspace/pybootchartgui$

Which linux system are you using? Fedora? Moblin? And what version of 
pybootchart gui
are you using.

Best
Anders

Original comment by anders.n...@gmail.com on 30 Aug 2009 at 2:58

GoogleCodeExporter commented 9 years ago
I also got this issue now.
I use the latest release pybootchartgui to test my bootchart.tgz as attached 
file.
And then I got ZeroDivisionError like below.

pybootchartgui-r124$ ./pybootchartgui.py bootchart.tgz 
Traceback (most recent call last):
  File "./pybootchartgui.py", line 7, in <module>
    sys.exit(main())
  File "pybootchartgui/pybootchartgui-r124/pybootchartgui/main.py", line 57, in main
    res = parsing.parse(args, options.prune)
  File "pybootchartgui-r124/pybootchartgui/parsing.py", line 218, in parse
    state = parse_paths(ParserState(), paths)
  File "pybootchartgui-r124/pybootchartgui/parsing.py", line 207, in parse_paths
    state = _do_parse(state, name, tf.extractfile(name))
  File "pybootchartgui-r124/pybootchartgui/parsing.py", line 180, in _do_parse
    state.ps_stats = _parse_proc_ps_log(file)
  File "pybootchartgui-r124/pybootchartgui/parsing.py", line 71, in _parse_proc_ps_log
    userCpuLoad, sysCpuLoad = process.calc_load(userCpu, sysCpu, time - ltime)
  File "pybootchartgui-r124/pybootchartgui/samples.py", line 66, in calc_load
    userCpuLoad = float(userCpu - self.last_user_cpu_time) / interval
ZeroDivisionError: float division

Something strange is that,"interval" would be zero sometimes.
I try to set interval=1 if interval=0, then the bootchart file would be 
generated successfully.
But I don't known if this behavior is legal?
Could someone give me some comment?

Original comment by chitarr...@gmail.com on 7 Jan 2011 at 8:15

Attachments:

GoogleCodeExporter commented 9 years ago
Hi chitarraXD,

I can see that in your bootchart.tgz/proc_ps.log file there are simply two 
samples timed at 2368. This shouldn't happen, but since it did happen for you I 
think it is a very reasonable workaround that you use (setting interval=1 if 
interval=0 ).

Best,
Anders

Original comment by anders.n...@gmail.com on 9 Jan 2011 at 1:27

GoogleCodeExporter commented 9 years ago
I have the same problem here when I use the latest pkg.
Here is the output message.
--------------

mike_chen@Fish:~/Downloads/pybootchartgui-r124$ ./pybootchartgui.py --verbose 
/tmp/android-bootchart/bootchart.tgz 
Traceback (most recent call last):
  File "./pybootchartgui.py", line 7, in <module>
    sys.exit(main())
  File "/home/mike_chen/Downloads/pybootchartgui-r124/pybootchartgui/main.py", line 57, in main
    res = parsing.parse(args, options.prune)
  File "/home/mike_chen/Downloads/pybootchartgui-r124/pybootchartgui/parsing.py", line 218, in parse
    state = parse_paths(ParserState(), paths)
  File "/home/mike_chen/Downloads/pybootchartgui-r124/pybootchartgui/parsing.py", line 207, in parse_paths
    state = _do_parse(state, name, tf.extractfile(name))
  File "/home/mike_chen/Downloads/pybootchartgui-r124/pybootchartgui/parsing.py", line 180, in _do_parse
    state.ps_stats = _parse_proc_ps_log(file)
  File "/home/mike_chen/Downloads/pybootchartgui-r124/pybootchartgui/parsing.py", line 80, in _parse_proc_ps_log
    avgSampleLength = (ltime - startTime)/(len(timed_blocks)-1) 
ZeroDivisionError: integer division or modulo by zero

Original comment by mike.wal...@gmail.com on 24 Feb 2012 at 12:01

Attachments: