added time parameters to getmetric function