Temporal Stability Sensor
The Temporal Stability Sensor shows how unstable the time of the world is.
Using a comparator, you can find out how close the world is to lagging, with higher redstone output meaning the world is closer to lagging.
You can use this to turn off farms automatically to prevent the server from lagging.