Real-time adaptive algorithm for resource monitoring