Fast and lightweight framework to collect system metrics