How to check if two data series change together?

26 Views Asked by At

I have a project which involves two time series of pings. One is the ping of google.com the other is the ping of my server. I'd like to compare these two time series and send an alert when the ping of my server reaches a certain threshold for a certain duration. I don't want to send an alert when it is just a short spike. I don't want to send alert either when both pings increases together, because that means it is a general network error of the monitoring tool and not that the problem is with my server. The first problem is more or less trivial, but I don't know how I should approach the second one. My first thought was correlation, but I just checked it with a few time series and it appears to be too sensitive to short spikes and jitter. Is there an algorithm that would solve this problem better?

1

There are 1 best solutions below

1
On

I checked meanwhile and I was wrong. A 5 point moving correlation appears to work in the beginning of the anomalies. Later it falls apart when we reach a plateau, but that's not a big deal. It works for short anomalies too except when there is a delay in time. So I'll us that to decide if the two series change together and I'll use a 5 point moving median to decide if we have a short or a long anomaly.