Performing Derivative On A Stream

hi, when using kapacitor to calculate the derivative of a value on a stream do i have to use the window node with it or can the derivative node be used independently?

for example, if i’m trying to calculate the bit rate for an interface every minute on the fly should i do this:

var outOctets = stream
        .where(lambda: "device" == 'ROUTER1' AND "type" == 'egress_stats.if_octets')
    |eval(lambda: "value" / 60 * 8 )

or can i leave out the window node? currenlty this is not working.

1 Like

never mind, i found my problem.

had to change -------------> |eval(lambda: “value” / 60 * 8 )
to this ------------------------> |eval(lambda: int(“value”) / 60 * 8 )

1 Like