metrics: initial commit, moved from common; make use of common.System in more places