[Bro-Dev] #337: BroCtl's top has trouble with large values

Bro Tracker bro at tracker.icir.org
Wed Dec 8 02:51:03 PST 2010


#337: BroCtl's top has trouble with large values
------------------------+------------------------
 Reporter:  robin       |      Owner:  robin
     Type:  Problem     |     Status:  new
 Priority:  Normal      |  Milestone:  Bro1.6
Component:  BroControl  |    Version:  git/master
------------------------+------------------------
 From Craig:

  File "/home/users/bro/bro-151/lib/broctl/BroControl/control.py", line
 588, in getTopOutput
    d["vsize"] = int(p[1])
 ValueError: invalid literal for int(): 2.17684e+09

 Here's a possible fix for this:

    d["vsize"] = int(float(p[1]))

                Craig

 fun 2 % !!
 ipython
 Python 2.6.6 (r266:84292, Sep 29 2010, 08:18:31)
 Type "copyright", "credits" or "license" for more information.

 IPython 0.10.1 -- An enhanced Interactive Python.
 ?         -> Introduction and overview of IPython's features.
 %quickref -> Quick reference.
 help      -> Python's own help system.
 object?   -> Details about 'object'. ?object also works, ?? prints more.

 In [1]: p = [ 'foo', '2.17684e+09' ]

 In [2]: print type(p[1])
 <type 'str'>

 In [3]: print p[1]
 2.17684e+09

 In [4]: d = {}

 In [5]: d["vsize"] = int(float(p[1]))

 In [6]: print d["vsize"]
 2176840000

 In [7]: print type(d["vsize"])
 <type 'int'>

-- 
Ticket URL: <http://tracker.icir.org/bro/ticket/337>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list