Closed nebrera closed 10 years ago
Hi Carlos,
Could you please provide tests for this? :)
please add to the console delegators too: https://github.com/liquidm/ruby-druid/blob/master/lib/druid/console.rb#L70
Hi ryanza! I just uploaded a test to check the topn method. Let me know if you need something more! :)
Cool thanks!
No problem!
But I must mention that druid response's to topn query is a bit particular. It returns a array with just one element, which contains the timestamp and the result (another array with the actual values).
An example:
[
{
"timestamp": "2014-01-13T11:26:00.000Z",
"result":[
{
"events": 48315,
"msg": "top1msg"
},
{
"events": 22344,
"msg": "top2msg"
},
{
"events":17202,
"msg": "top3msg"
},
{
"events":13223,
"msg": "top4msg"
},
{
"events":11685,
"msg": "top5msg"
}
]
}
]
That provokes a crash on the console (bin/dripl), right here https://github.com/liquidm/ruby-druid/blob/master/lib/druid/console.rb#L14, when you try to do a topn query with the method I provided, since "result.last", in that context, is an Array and not a Hash
Sorry about that, I never used the console you provide so I think I wont be very useful with that. I hope you guys could think something about that.
Let me know if I can help you!
Ive pushed out a new version with your code - might need to look into fixing the repl now. :)
...ion, the metric and the threshold to use)