Have you seen the Join 
node https://docs.influxdata.com/kapacitor/v1.0/nodes/join_node/ It should 
do exactly what you want.

On Thursday, November 3, 2016 at 6:54:41 PM UTC-6, [email protected] wrote:
>
> I'm wondering if it would actually be possible to calculate exponential 
> moving average using a tick script.
>
> for instance where exponential moving average for number of pings in a 
> time period would be calculated as follows:
>
> Multiplier: (2 / (Time periods + 1) ) = (2 / (10 + 1) ) = 0.1818 (18.18%)
>
> EMA: ((# of pings for some period - last plotted EMA point) x multiplier) + 
> last plotted EMA point
>
>
> To do this I need to do something like
>
>
>
> var currentPings = batch
>         |query('select sum(count) from telegraf.seven_days.pos_heartbeat')
>                 .every(1m)
>                 .period(1m)
>                 .groupBy(time(1m), 'fingerprint')
>                 .align()
>                 .offset(1m)
>
> var pingsWithMultiplier = currentPings
>         |eval(lambda: 2.0 / (10.0 + 1.0), lambda: "sum" + 0.0)
>                 .as('multiplier', 'total')
>
> var lastEma = batch
>        |query('select last(avg) from 
> telegraf.seven_days.pos_heartbeat_ema')
>               .groupBy('fingerprint')
>
> ---- at this point I need a way to combine lastEma and pingsWIthMultiplier 
> nodes on tags where 'fingerprint' == 'fingerprint' ---
>
> Based on the documentation I've read, there's not currently a good way to 
> do this. Am I missing something? Thanks in advance for any guidance! 
>
>
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/0daa4b27-9b9e-4b3a-bf46-992fafacd407%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to