querying for paths with top-n highest values

Asked by tyler

I've looked at the source, and I don't see this functionality, so without spending
so much time trying to figure out how the data sits on disk, is there any easy way to do this?

Forgive me if this is outside of the scope of this project but...

I don't mind doing a little hacking, I think it could be done by keeping an auxiliary "internal" whisper db that just holds
top values in any given path, eg:

(I'm shooting from the hip here so be gentle if this is comically flawed)

for paths like:
/foo/bar/1
/foo/bar/2
...
/foo/bar/whatever

keep a flat index that ranks the values from 1st to Nth place (over time, of course) and then a client can ask "show me the top N paths in the last ___ [time interval]", where the first flat index gets consulted first for top values in a path for a time frame, then the main db is queried for fine grained data per path.

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
tyler (tyler-chickn) said :
#1

er, i left out the part about "querying for the top paths in /foo/bar", which would go like:

values are inserted for /foo/bar/{1...n},

consult the flat rank index for all paths starting with "/foo/bar"......
.....

now i see this is much more complicated than i thought.....;)

back to the drawing board.

Revision history for this message
chrismd (chrismd) said :
#2

Actually I think there is a simple way to implement what you are describing. Graphite can apply functions to your data at rendering time and I think what you're after could be achieved with a new function and a wildcard pattern (something like target=highest(10, foo.bar.*) for the highest 10 metrics matching the pattern foo.bar.*). Does this sound like what you're after?

Can you help with this problem?

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

To post a message you must log in.