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

Percent by type #122

Open bnkr opened 10 years ago

bnkr commented 10 years ago

This is a "first thing that works" implementation for a query percent by <tag> as discussed in #121 which will result in graph targets roughly meaning (for percent by tag2):

asPercent(metric.tag1=x.tag2=y, sumSeries(metric.tag1=x.tag2=*))

This also works when you do something like percent by type sum by core, you get a metric like:

asPercent(sumSeries(metric.core=*.metric=idle), sumSeries(metric.core=*.metric=*))

Additionally I added a utility to introspect the process of generating a query and give a very simple graphite url for testing purposes. Could come in handy for other people.

I expect this pull request needs some refactoring but I wanted to create it early so you can get an idea of where I went with it.

A couple of things I intend to fix:

I think in general build_from_targets would be easier to change if it had a bit more of an object language, rather than just dicts everywhere. In particular I found it quite hard to work out if I was computing something which had already been done elsewhere.

Dieterbe commented 10 years ago

I like query_explorer.py (and agree with your todo's for it)

bnkr commented 10 years ago

Query explorer now loads the proper configuration and I tidied up build_from_targets a little.

I think that's enough to merge, but there's a few things which could be nice to consider in other patches:

Dieterbe commented 9 years ago

i'm sorry i've been dropping the ball on this. i've been so busy. hopefully i can find some time for this soon

bnkr commented 9 years ago

No problem. If you have some things that you think I might be able to do to make it easier then let me know.