refactor metricstatistic code

try to avoid too many redis connection
move Message to metrictools.Message