Added code attribute to Metric class.

Signed off by: Daniel Bucher <daniel.bucher88@gmail.com>