pyATS Tip: Use pyATS APIs, like get_platform_memory_usage()
, to easily retrieve device performance metrics, such as memory usage, from network devices, which you can later use within your test cases.
Example below 👇
from genie import testbed
testbed = testbed.load("testbed.yml")
device = testbed.devices["leaf1"]
device.connect()
mem_usage_percent = device.api.get_platform_memory_usage()
print(mem_usage_percent)
# Output:
# 8.501163165128544
Thanks to Arsalan Yahyazadeh for sharing this tip!