collect and store metrics