<s> import psutil <EOL> from checks import AgentCheck <EOL> class SystemCore ( AgentCheck ) : <EOL> def check ( self , instance ) : <EOL> cpu_times = psutil . cpu_times ( percpu = True ) <EOL> self . gauge ( "<STR_LIT>" , len ( cpu_times ) ) <EOL> for i , cpu in enumerate ( cpu_times ) : <EOL> for key , value in cpu . _asdict ( ) . iteritems ( ) : <EOL> self . rate ( <EOL> "<STR_LIT>" . format ( key ) , <EOL> <NUM_LIT> * value , <EOL> tags = [ "<STR_LIT>" . format ( i ) ] <EOL> ) </s>
