nput arguments: none ### ### The following EEM environment variables are used: none ### ### Environment variables are used by the policies invoked from this script. ### Typically: ### _perf_iterations is used set the iteration count for the policy. ### _perf_cmd1, _perf_cmd2, _perf_cmd3 are used to specify ### optional commands to be executed as part of the test. ### See ap_perf_test_base_cpu.tcl for a more thorough explanation. ### ### Description: ### Script used to launch policy performance tests. ### Policies are passed 1 input: ### a beginning iteration count set to 0 ### ### Outputs: ### Console output via activated policies. ### ### Usage Example: ### For this example we will use the cpu usage test. ### ### >conf t ### >service timestamps log datetime msec ### >event manager environment _perf_iterations 100 ### >event manager environment _perf_cmd1 show int counters protocol status ### >event manager policy ap_perf_base_cpu.tcl ### >event manager policy no_perf_test_init.tcl ### >end ### Oct 16 14:57:17.284: %SYS-5-CONFIG_I: Configured from console by console ### >event manager run no_perf_test_init.tcl ### ### Oct 16 14:57:17.284: %SYS-5-CONFIG_I: Configured from console by console ### >event manager run no_perf_test_init.tcl ### ### Oct 16 19:32:02.772: %HA_EM-6-LOG: ### eem_policy/no_perf_test_init.tcl: EEM performance test start ### Oct 16 19:32:03.115: %HA_EM-6-LOG: ### eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 1 ### Oct 16 19:32:03.467: %HA_EM-6-LOG: ### eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 2 ### ... ### Oct 16 19:32:36.936: %HA_EM-6-LOG: ### eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test iteration 100 ### Oct 16 19:32:36.936: %HA_EM-6-LOG: ### eem_policy/ap_perf_test_base_cpu.tcl: EEM performance test end ### ### The user must calculate execution time and average time of execution. ### In this example, total time = 19:32:36.936 - 19:32:02.772 = 34.164 ### Average script execution time = 341.64 milliseconds ### namespace import ::cisco::eem::* namespace import ::cisco::lib::* # query the event info array set arr_einfo [event_reqinfo] if {$_cerrno != 0} { set result [format "component=%s; subsys err=%s; posix err=%s;\n%s" \ $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str] error $result } action_syslog priority info msg "EEM performance test start" if {$_cerrno != 0} { set result [format \ "component=%s; subsys err=%s; posix err=%s;\n%s" \ $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str] error $result } # cause the first iteration to run event_publish sub_system 798 type 9999 arg1 0 if {$_cerrno != 0} { set result [format \ "component=%s; subsys err=%s; posix err=%s;\n%s" \ $_cerr_sub_num $_cerr_sub_err $_cerr_posix_err $_cerr_str] error $result }