In [11]:
%matplotlib inline
from loganalyser import jvm, plot
In [12]:
jvm = reload(jvm)
plot = reload(plot)
gc = jvm.parse('data/grass-sheep.log', 'Europe/Berlin')
#gc = jvm.parse('data/FReportServer_gc.log', 'Europe/Berlin')
gc.head() # note timestamps are in UTC! (workaround for to_json)
Out[12]:
In [13]:
gc.dtypes
Out[13]:
In [14]:
# find out boundaries to select a timeframe -> use ms since epoch
# in a next version boundaries are provided by ipython widgets!
import datetime
from pytz import timezone
print gc.ix[20]
# proper way with tz http://www.saltycrane.com/blog/2009/05/converting-time-zones-datetime-objects-python/
ts = timezone('Europe/Berlin').localize(datetime.datetime.strptime('2013-07-18 11:24:45.356000', '%Y-%m-%d %H:%M:%S.%f'))
print int(ts.strftime("%s")) * 1000
In [15]:
plot.set_styles(['jvm'])
Out[15]:
In [16]:
plot = reload(plot)
plot.draw_graph('jvm', gc.to_json(orient='records'))
Out[16]:
In [ ]: