Predicting potential failure in real-time through monitoring and detection of anomalous behaviour using hardware performance counters