Create an alert based on moving time frame

Hi - is there a way to create an alert based on an increase/decrease in average response time for the past 5 min compared to the last 30 mins?
For example, if the average response time for past 30 mins is 300ms and the average response time for the past 5 mins is 500 ms, which is quite a jump, is there a way to trigger an alert based on it?