Write system metrics to DB