These are chat archives for juttle/juttle

15th
Mar 2016
Kirill
@infloop
Mar 15 2016 18:52
Hi! I am researching Juttle. Looks awesome. I have only one question: Can I process every point and do smth externally? I need to increment some counters in Redis and use the increment result? Something like: | put redis_write_command = 'HINCRBY juttle_hash value 1' | put value = write redis | view table
Mark Stemm
@mstemm
Mar 15 2016 18:53
Hi, thanks! Does ‘smth’ mean something?
Kirill
@infloop
Mar 15 2016 18:55
Edited the question.
I know that I can't use put after sinks.
But is it possible somehow?
Mark Stemm
@mstemm
Mar 15 2016 18:56
In order to do that, you’d want to fork the program into 2 branches. Something like the following:
... | (put redis_write_command = 'HINCRBY juttle_hash value 1' | write redis; view table)
in one branch, you’re preparing the points to be written to redis. in the other branch, you’re viewing the output in a table
Kirill
@infloop
Mar 15 2016 18:59
Will check now.
Mark Stemm
@mstemm
Mar 15 2016 19:01
oh if you want the increment to be reflected in the table output, you’d have to do the increment in juttle instead of in the HINCRBY
something like read redis | put value = value + 1 | (write redis; view table)
Kirill
@infloop
Mar 15 2016 19:01
Hmm... That's the problem that I need to increment in Redis...
And somehow get the value from it back in the middle of the stream.
Like native Node.js stream Transform.
Michael Demmer
@demmer
Mar 15 2016 19:03

Hi @infloop — unfortunately there really isn’t a good way to do this now.

One idea would be to potentially extend the language so that in addition to read and write there would be a way for an adapter to expose an update implementation that would work as you suggest.

But this isn’t something we can do right now.
Kirill
@infloop
Mar 15 2016 19:05
Oh, it is a pity :( I really love the idea of Juttle. Is it hard to extend the language for an adapter update? I mean I can try to do that.
Mark Stemm
@mstemm
Mar 15 2016 19:08
I suppose you could repeat the work of what the HINCRBY does. One thing that wouldn’t be covered is the side-effect stuff of creating the hash if doesn’t exist and initializing the field if it doesn’t exist. And I’m guessing you’re relying on that.
Kirill
@infloop
Mar 15 2016 19:11
The value I store in HINCRBY can be updated from different apps, even from different machines.
So, I have to do that in Redis... I think @demmer offered a good solution.
Mark Stemm
@mstemm
Mar 15 2016 19:12
yeah so as @demmer said that kind of operation isn’t a good match for the capabilities of the adapters right now
Kirill
@infloop
Mar 15 2016 19:12
Yeah.
Mark Stemm
@mstemm
Mar 15 2016 19:13
regardless feel free to file a github issue for the feature request so we can keep track of it when looking for things to add
Kirill
@infloop
Mar 15 2016 19:13
I wonder is it hard for me to extend these capabilities?
Hmm... I think I got the idea in sources. Will try to.
Thanks.
Michael Demmer
@demmer
Mar 15 2016 20:01
Cool — feel free to shoot questions our way. I’m not 100% sure this is the best way to accomplish what you’d want, but there have been other cases where we’ve wanted to do similar things.