Question

I have a monitoring application in python 2.6 that calculates the number of entries in a queue (queue_len). I want to create a simple function that can use these queue_len rate of change values over time and extract a trend from them.

The goal is to start up or shut down queue processing nodes depending of the +ive or -ive trend over time and not flip flop.

MACD from the financial arena looks sort of what I need or does it? Looking for any help here.

Was it helpful?

Solution

Isn't that just a simple derivative?

def derivs(l):
  return [l[i + 1] - l[i] for i in range(len(l) - 1)]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top