metric.cpp added to metrics branch