refactored metric interface and generalized the query methods to take more time and agent args