How to Get a Device's Memory Usage with pyATS APIs

How to Get a Device's Memory Usage with pyATS APIs

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!

Subscribe to our newsletter to keep updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox.
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!