kumar-nitish / harstorage

Automatically exported from code.google.com/p/harstorage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Timings error

GoogleCodeExporter opened this issue · comments

I am getting following error when I am trying to upload a .har file, retrieved 
with use of BrowserMob-proxy:

Error - <type 'exceptions.KeyError'>: 'timings'
URL: http://127.0.0.1:5000/results/upload
File 
'/usr/local/lib/python2.6/dist-packages/WebError-0.10.3-py2.6.egg/weberror/error
middleware.py', line 162 in __call__
  app_iter = self.application(environ, sr_checker)
File 
'/usr/local/lib/python2.6/dist-packages/Beaker-1.6.2-py2.6.egg/beaker/middleware
.py', line 155 in __call__
  return self.wrap_app(environ, session_start_response)
File 
'/usr/local/lib/python2.6/dist-packages/Routes-1.12.3-py2.6.egg/routes/middlewar
e.py', line 131 in __call__
  response = self.app(environ, start_response)
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/wsgiapp.py',
 line 107 in __call__
  response = self.dispatch(controller, environ, start_response)
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/wsgiapp.py',
 line 312 in dispatch
  return controller(environ, start_response)
File 
'/usr/local/lib/python2.6/dist-packages/harstorage-0.6-py2.7.egg/harstorage/lib/
base.py', line 19 in __call__
  return WSGIController.__call__(self, environ, start_response)
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/
core.py', line 211 in __call__
  response = self._dispatch_call()
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/
core.py', line 162 in _dispatch_call
  response = self._inspect_call(func)
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/
core.py', line 105 in _inspect_call
  result = self._perform_call(func, args)
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/controllers/
core.py', line 57 in _perform_call
  return func(**args)
File '<string>', line 2 in upload
File 
'/usr/local/lib/python2.6/dist-packages/Pylons-1.0-py2.6.egg/pylons/decorators/r
est.py', line 33 in check_methods
  return func(*args, **kwargs)
File 
'/usr/local/lib/python2.6/dist-packages/harstorage-0.6-py2.7.egg/harstorage/cont
rollers/results.py', line 312 in upload
  har.analyze()
File 
'/usr/local/lib/python2.6/dist-packages/harstorage-0.6-py2.7.egg/harstorage/lib/
HAR.py', line 129 in analyze
  dns_time        = max( entry['timings']['dns'],                                0)
KeyError: 'timings'


CGI Variables
-------------
  CONTENT_LENGTH: '-1'
  CONTENT_TYPE: 'multipart/form-data; boundary=----WebKitFormBoundaryrAHNPUwJZmxJqMHC'
  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
  HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'
  HTTP_ACCEPT_ENCODING: 'gzip,deflate,sdch'
  HTTP_ACCEPT_LANGUAGE: 'en-US,en;q=0.8,sk;q=0.6'
  HTTP_CACHE_CONTROL: 'max-age=0'
  HTTP_CONNECTION: 'keep-alive'
  HTTP_COOKIE: 'phaseInterval=-1'
  HTTP_HOST: '127.0.0.1:5000'
  HTTP_ORIGIN: 'http://127.0.0.1:5000'
  HTTP_REFERER: 'http://127.0.0.1:5000/'
  HTTP_USER_AGENT: 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11'
  PATH_INFO: '/results/upload'
  REMOTE_ADDR: '127.0.0.1'
  REQUEST_METHOD: 'POST'
  SERVER_NAME: '0.0.0.0'
  SERVER_PORT: '5000'
  SERVER_PROTOCOL: 'HTTP/1.1'


WSGI Variables
--------------
  application: <beaker.middleware.SessionMiddleware object at 0xa5161cc>
  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0xa5161cc>>
  beaker.session: {'_accessed_time': 1329918827.4170849, '_creation_time': 1329918827.4170849}
  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0xb72d2eac>
  paste.registry: <paste.registry.Registry object at 0xa6dc38c>
  paste.throw_errors: True
  pylons.action_method: <bound method ResultsController.upload of <harstorage.controllers.results.ResultsController object at 0xa6e09ec>>
  pylons.controller: <harstorage.controllers.results.ResultsController object at 0xa6e09ec>
  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
  pylons.pylons: <pylons.util.PylonsContext object at 0xa6e0c0c>
  pylons.routes_dict: {'action': u'upload', 'controller': u'results'}
  routes.route: <routes.route.Route object at 0xa51604c>
  routes.url: <routes.util.URLGenerator object at 0xa6d876c>
  webob._parsed_post_vars: (MultiDict([('file', FieldStorage('file', '1329918662938.har')), ('upload', 'Upload')]), <FakeCGIBody at 0xa6cf74c viewing MultiDict([('fi...d')])>)
  webob.adhoc_attrs: {'errors': 'ignore', 'language': 'en-us'}
  wsgi process: 'Multithreaded'
  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0xa6d876c>, {'action': u'upload', 'controller': u'results'})

I am retrieving this .har from Java code, which can be found here:
https://github.com/jhuska/client-side-perf/blob/master/src/test/java/org/richfac
es/performance/TestClientSidePerformanceWebDriver.java#L160

Sometimes it produces right .har(exactly the same code and sometimes not)

Original issue reported on code.google.com by goose...@gmail.com on 22 Feb 2012 at 2:00

Attachments:

Well, it looks like this file does not meet HAR spec:

log.entries[78].timings is missing and it is not optional

It is most likely BMP issue but I can consider less strict upload verification 
in future releases.

Original comment by Pavel.Pa...@gmail.com on 22 Feb 2012 at 2:11

  • Changed state: Accepted
Thank you for your super fast reaction.

Please, is the next release planned for some concrete date ?

Original comment by goose...@gmail.com on 22 Feb 2012 at 2:58

I think next release will be available until the end of February.

Original comment by Pavel.Pa...@gmail.com on 22 Feb 2012 at 6:03

Original comment by Pavel.Pa...@gmail.com on 6 Mar 2012 at 1:17

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

Original comment by Pavel.Pa...@gmail.com on 6 Mar 2012 at 1:19

  • Added labels: Component-Logic, OpSys-All
[deleted comment]
Hi,
I've the same problem for upload file HAR in HarStorage.
Is the next release planned for some date?
At the moment I use this web site for upload my file HAR 
http://www.softwareishard.com/har/viewer/ and I put "Validate data before 
processing" at false.
Thanks

Silvio

Original comment by sm.spi...@gmail.com on 15 May 2013 at 5:04