Collecting Device performance metrics during test execution

hello folks.
I have a question. i’m learning Appium for a mobile Poc. i was able to execute a small test case of pushing my .apk file to an android device and running few screens of my app from the Java code. How can i collect the performance of the device during the time that test case was run? Does Appium provides or are there any add-ins that we can use to collect device metrics (like cpu, memory, battery usage etc) when the Appium tests eas running?

Latest Java Client API for Appium

thanks Umar for the information.