Health Critical with Root Cause Data collection script is running too slow and it is timedout

Health Critical with Root Cause Data collection script is running too slow and it is timedout

I found my APM generated email error for my system like this 


This is an auto generated e-mail triggered because of the following entities being monitored :

Monitor

XXX

Attribute

Health

Reasons

Health of XXX is critical

Root Cause
Root Cause : 
  1. Health of XXX is critical. 
    Root Cause : 
    1. Data collection script is running too slow and it is timedout.

Additional information
This information has been generated by APM

which should I focus to avoid this error 

thanks