Merge changes I23b657a2,I7998ae83 into main

* changes:
  Add tests for metrics
  Fix Tests for improved metrics.