integral(multiplySeries(x,y)) does not work

Asked by Adam Mitchell

I want to know how long my system spends on a task over time.

x is my counter. y is my average duration.

I can do 'multiplySeries(x, y)' to see time spent on the task at a point in time.

I want to total the time up over the past four hours, so I tried integral(multiplySeries(x,y)) but just get a broken image icon.

Should this work, or am I misunderstanding how this is supposed to work?

This is the graphite/storage/log/webapp/access.log showing the 500 error:

174.47.56.114 - - [03/Jul/2012:14:22:52 +0000] "GET /render/?width=1059&height=474&_salt=1341325372.533&from=-1hours&target=integral(multiplySeries(count%2Cmean_90)) HTTP/1.1" 500 1505

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Nicholas Leskiw (nleskiw) said :
#1

Right click the broken icon and choose view image. That should give you a stack trace, please post it.

Adam Mitchell <email address hidden> wrote:

>Question #202162 on Graphite changed:
>https://answers.launchpad.net/graphite/+question/202162
>
>Description changed to:
>I want to know how long my system spends on a task over time.
>
>x is my counter. y is my average duration.
>
>I can do 'multiplySeries(x, y)' to see time spent on the task at a point
>in time.
>
>I want to total the time up over the past four hours, so I tried
>integral(multiplySeries(x,y)) but just get a broken image icon.
>
>Should this work, or am I misunderstanding how this is supposed to work?
>
>This is the graphite/storage/log/webapp/access.log showing the 500
>error:
>
>
>174.47.56.114 - - [03/Jul/2012:14:22:52 +0000] "GET /render/?width=1059&height=474&_salt=1341325372.533&from=-1hours&target=integral(multiplySeries(count%2Cmean_90)) HTTP/1.1" 500 1505
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~graphite-dev
>Post to : <email address hidden>
>Unsubscribe : https://launchpad.net/~graphite-dev
>More help : https://help.launchpad.net/ListHelp

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#2

This needs more information from the bug reporter.

Revision history for this message
Adam Mitchell (adamhmitchell) said :
#3

This is the stack trace:

Graphite encountered an unexpected error while handling your request.

Please contact your site administrator if the problem persists.

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/opt/graphite/webapp/graphite/render/views.py", line 104, in renderView
    seriesList = evaluateTarget(requestContext, target)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 10, in evaluateTarget
    result = evaluateTokens(requestContext, tokens)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 21, in evaluateTokens
    return evaluateTokens(requestContext, tokens.expression)
  File "/opt/graphite/webapp/graphite/render/evaluator.py", line 29, in evaluateTokens
    return func(requestContext, *args)
  File "/opt/graphite/webapp/graphite/render/functions.py", line 678, in integral
    for val in series:
TypeError: 'NoneType' object is not iterable

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#4

I'm able to reproduce this intermittently but I can't quite track it down yet. I'll keep working on it.
I think that multiplySeries() is not returning a result sometime, and so integral chokes on a 'None'.
Can't tell why, I'll have to look at some more data.

Revision history for this message
alexandra choutko (alexandra-choutko) said :
#5

Did you get a fix for this? I am getting the same problem after a clean install of ubuntu 12.04 and graphite 0.9.10.

Graphite encountered an unexpected error while handling your request.

Please contact your site administrator if the problem persists.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/handlers/base.py", line 101, in get_response
    request.path_info)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py", line 300, in resolve
    sub_match = pattern.resolve(new_path)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py", line 209, in resolve
    return ResolverMatch(self.callback, args, kwargs, self.name)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py", line 216, in callback
    self._callback = get_callable(self._callback_str)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/utils/functional.py", line 27, in wrapper
    result = func(*args)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/core/urlresolvers.py", line 92, in get_callable
    lookup_view = getattr(import_module(mod_name), func_name)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/graphite/webapp/graphite/browser/views.py", line 20, in <module>
    from graphite.util import getProfile, getProfileByUsername, defaultUser, json
  File "/opt/graphite/webapp/graphite/util.py", line 55, in <module>
    defaultUser = User.objects.get(username='default')
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/manager.py", line 131, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 361, in get
    num = len(clone)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 85, in __len__
    self._result_cache = list(self.iterator())
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/query.py", line 291, in iterator
    for row in compiler.results_iter():
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/sql/compiler.py", line 763, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/models/sql/compiler.py", line 817, in execute_sql
    cursor = self.connection.cursor()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/backends/__init__.py", line 308, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/backends/sqlite3/base.py", line 281, in _cursor
    self._sqlite_create_connection()
  File "/usr/local/lib/python2.7/dist-packages/Django-1.4.1-py2.7.egg/django/db/backends/sqlite3/base.py", line 271, in _sqlite_create_connection
    self.connection = Database.connect(**kwargs)
OperationalError: unable to open database file

Revision history for this message
alexandra choutko (alexandra-choutko) said :
#6

Ok fixed it. I had to add a DATABASES block because of the new django 1.4. However I added it in settings.py. I removed it from setting.py and added it in local_settings.py. It works now.

DATABASES = {
    'default': {
        'NAME': '/opt/graphite/storage/graphite.db',
        'ENGINE': 'django.db.backends.sqlite3',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': ''
    }
}

Can you help with this problem?

Provide an answer of your own, or ask Adam Mitchell for more information if necessary.

To post a message you must log in.