vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

Automatically apply a derivative function when necessary to satisfy a requested unit #59

Closed thepaul closed 10 years ago

thepaul commented 10 years ago

Just a draft- this will probably need more changes

thepaul commented 10 years ago

I like Nose best, myself, but all of the python test frameworks work fairly well with the python-builtin unittest and doctest, so switching between them should be super easy if you ever want to.

Dieterbe commented 10 years ago

There seems to be a problem with aggregates. this works: network dfvimeodfs avg over 1h this: network dfvimeodfs avg over 1h sum by device,type causes:

Traceback (most recent call last):
  File "/home/dieter/workspaces/eclipse/graph-explorer/bottle.py", line 764, in _handle
    return route.call(**args)
  File "/home/dieter/workspaces/eclipse/graph-explorer/bottle.py", line 1575, in wrapper
    rv = callback(*a, **ka)
  File "/home/dieter/workspaces/eclipse/graph-explorer/app.py", line 320, in graphs
    return handle_graphs(query, False)
  File "/home/dieter/workspaces/eclipse/graph-explorer/app.py", line 342, in handle_graphs
    return render_graphs(query, deps=deps)
  File "/home/dieter/workspaces/eclipse/graph-explorer/app.py", line 418, in render_graphs
    graphs_targets_matching = build_graphs_from_targets(targets_matching, query)[0]
  File "/home/dieter/workspaces/eclipse/graph-explorer/app.py", line 236, in build_graphs_from_targets
    target_modifier(target, graph_config)
  File "/home/dieter/workspaces/eclipse/graph-explorer/query.py", line 139, in apply_requested_unit
    tags = target['tags']
KeyError: 'tags'
Dieterbe commented 10 years ago

This code is fantastic and I merged it. I did commit a few small bugfixes, we have some more things to address but I'll open those as separate issues. Great work!