Bug fix in extracting data from stream

master
Steve L. Nyemba 8 years ago
parent 524376bb70
commit 55884a4038

@ -56,7 +56,7 @@ f.close()
#
#
from threading import Thread, RLock
p = {'uri':'http://dev.the-phi.com:5984','dbname':'monitor','uid':'logs','filename':'logs.JSON'}
p = {'uri':'http://localhost:5984','dbname':'monitor','uid':'logs','filename':'logs.JSON'}
factory = DataSourceFactory()
gWriter = factory.instance(type='CouchdbWriter',args=p)
gReader = factory.instance(type='CouchdbReader',args=p)

@ -141,8 +141,9 @@ class DetailProcess(Analysis):
self.names = names;
def split(self,name,stream):
pattern = " (\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20".replace(":name",name)
g = re.match(pattern,stream)
pattern = "(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)\x20*(\d+.{0,1}\d*)".replace(":name",name).strip()
g = re.match(pattern,stream.strip())
if g :
return list(g.groups())+[name]
else:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -18,7 +18,7 @@ class TestMonitorServer(unittest.TestCase):
self.assertTrue(p.evaluate('PATH') == 0)
def test_RunningProcess(self):
p = DetailProcess()
p.init(['rabbitmq-server','python','apache2'])
p.init(['kate','firefox']) #['rabbitmq-server','python','apache2','firefox'])
r = p.composite()
self.assertTrue(r)

Loading…
Cancel
Save