X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppCounters.py;h=054900f31fce53ba5ddfb558bee030f953a2e8c5;hb=79f5ba9bf7656972dd988508eff9465562dde42c;hp=bb8a8d2c285ab8086740804f4c6d831ca40b6b72;hpb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;p=csit.git diff --git a/resources/libraries/python/VppCounters.py b/resources/libraries/python/VppCounters.py index bb8a8d2c28..054900f31f 100644 --- a/resources/libraries/python/VppCounters.py +++ b/resources/libraries/python/VppCounters.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2020 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -114,7 +114,7 @@ class VppCounters: ) @staticmethod - def vpp_show_runtime_counters_on_all_duts(nodes): + def vpp_show_runtime_on_all_duts(nodes): """Clear VPP runtime counters on all DUTs. :param nodes: VPP nodes. @@ -125,8 +125,8 @@ class VppCounters: VppCounters.vpp_show_runtime(node) @staticmethod - def vpp_show_hardware_verbose(node): - """Run "show hardware-interfaces verbose" debug CLI command. + def vpp_show_hardware(node): + """Run "show hardware" debug CLI command. :param node: Node to run command on. :type node: dict @@ -144,10 +144,21 @@ class VppCounters: :param node: Node to run command on. :type node: dict """ - PapiSocketExecutor.run_cli_cmd( + PapiSocketExecutor.run_cli_cmd_on_all_sockets( node, u"show memory verbose api-segment stats-segment main-heap" ) + @staticmethod + def vpp_show_memory_on_all_duts(nodes): + """Run "show memory" on all DUTs. + + :param nodes: VPP nodes. + :type nodes: dict + """ + for node in nodes.values(): + if node[u"type"] == NodeType.DUT: + VppCounters.vpp_show_memory(node) + @staticmethod def vpp_clear_runtime(node): """Run "clear runtime" CLI command. @@ -160,7 +171,7 @@ class VppCounters: ) @staticmethod - def vpp_clear_runtime_counters_on_all_duts(nodes): + def vpp_clear_runtime_on_all_duts(nodes): """Run "clear runtime" CLI command on all DUTs. :param nodes: VPP nodes. @@ -171,7 +182,7 @@ class VppCounters: VppCounters.vpp_clear_runtime(node) @staticmethod - def vpp_clear_hardware_counters(node): + def vpp_clear_hardware(node): """Run "clear hardware" CLI command. :param node: Node to run command on. @@ -184,18 +195,18 @@ class VppCounters: ) @staticmethod - def vpp_clear_hardware_counters_on_all_duts(nodes): - """Clear hardware counters on all DUTs. + def vpp_clear_hardware_on_all_duts(nodes): + """Clear hardware on all DUTs. :param nodes: VPP nodes. :type nodes: dict """ for node in nodes.values(): if node[u"type"] == NodeType.DUT: - VppCounters.vpp_clear_hardware_counters(node) + VppCounters.vpp_clear_hardware(node) @staticmethod - def vpp_clear_errors_counters(node): + def vpp_clear_errors(node): """Run "clear errors" CLI command. :param node: Node to run command on. @@ -206,7 +217,7 @@ class VppCounters: ) @staticmethod - def vpp_clear_error_counters_on_all_duts(nodes): + def vpp_clear_errors_on_all_duts(nodes): """Clear VPP errors counters on all DUTs. :param nodes: VPP nodes. @@ -214,19 +225,17 @@ class VppCounters: """ for node in nodes.values(): if node[u"type"] == NodeType.DUT: - VppCounters.vpp_clear_errors_counters(node) + VppCounters.vpp_clear_errors(node) @staticmethod def show_vpp_statistics(node): - """Show [error, hardware, interface] stats. + """Show [errors, hardware] stats. :param node: VPP node. :type node: dict """ VppCounters.vpp_show_errors(node) - VppCounters.vpp_show_hardware_verbose(node) - VppCounters.vpp_show_runtime(node) - VppCounters.vpp_show_memory(node) + VppCounters.vpp_show_hardware(node) @staticmethod def show_statistics_on_all_duts(nodes): @@ -241,14 +250,13 @@ class VppCounters: @staticmethod def clear_vpp_statistics(node): - """Clear [error, hardware, interface] stats. + """Clear [errors, hardware] stats. :param node: VPP node. :type node: dict """ - VppCounters.vpp_clear_errors_counters(node) - VppCounters.vpp_clear_hardware_counters(node) - VppCounters.vpp_clear_runtime(node) + VppCounters.vpp_clear_errors(node) + VppCounters.vpp_clear_hardware(node) @staticmethod def clear_statistics_on_all_duts(nodes):