ap_perf_test_base_cpu.tcl Sample Policy
The following sample policy measures the CPU performance of EEM policies.
::cisco::eem::event_register_appl sub_system 798 type 9999
#----------------------------------
# EEM policy used for measuring the cpu performance of EEM policies.
#
# July 2005, Cisco EEM team
#
# Copyright (c) 2005, 2006 by cisco Systems, Inc.
# All rights reserved.
#------------------
###
### Input arguments:
###
### arg1 $iter - current iteration count
###
### The following EEM environment variables are used:
###
### _perf_iterations (mandatory) - number of iterations over which we
### will run our measurement.
### Example:
### event manager environment _perf_iterations 100
###
### _perf_cmd1 (optional) - optional non interactive cli command
### to be executed as part of the
### measurement test.
### Example:
### event manager environment _perf_cmd1 enable
###
### _perf_cmd2 (optional) - optional non interactive cli command
### to be executed as part of the
### measurement test.
### To use _perf_cmd2, _perf_cmd1 MUST
### be defined.
### Example:
### event manager environment _perf_cmd2 show ver
###
### _perf_cmd3 (optional) - optional non interactive cli command
### to be executed as part of the
### measurement test.
### To use _perf_cmd3, _perf_cmd1 MUST
### be defined.
### Example:
### event manager environment _perf_cmd3 show int counters protocol status
###
### Description:
### Iterate through _perf_iterations of this policy.
### It is up to the user to calculate the average
### execution time based on the system timestamps.
### Optional commands _perf_cmd1,
### _perf_cmd2 and _perf_cmd3 are executed if defined.
###
### A value of 100 is a good starting point.
###
### Outputs:
### Console output.
###
### Usage example:
### >conf t
### >service timestamps debug datetime msec
### >event manager environment _perf_iterations 100
### >event manager policy ap_perf_base_cpu.tcl
### >event manager policy no_perf_test_init.tcl
### >end
### 2d19h: %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
###
Consolidated Platform Configuration Guide, Cisco IOS Release 15.2(4)E (Catalyst 2960-X Switches)
1813
Configuration Examples for Writing Embedded Event Manager Policies Using Tcl