trying to duplicate the native device metrics feature