fix many bug

metric analyzer
heartbeat