The monitor service in CP (the z/VM control program) is what provides data to performance monitors or any other program that wants more details about what CP is doing. The main user of monitor data is for monitoring performance, using a product such as IBM's z/VM Performance Toolkit (also known as Perfkit.) The monitor is configured using the CP MONITOR command and then the performance monitor loads a special memory segment (usually named MONDCSS) to actually retrieve data from CP. Coordination with CP occurs using IUCV to communicate the monitor system service which is named *MONITOR. The CP MONITOR command sets an interval (called the monitor interval) which defines how often CP collects data from its counters and makes it available in the monitor segment. The default time for this interval is 1 minute.
All of the above it just background about what I wanted to post today. When you start the monitor, CP collects data for the monitor interval and then notifies any application that is connected to *MONITOR that new data is available. It keeps doing this until the monitor is stopped. I was asked once if there was a way to set the monitor intervals to start at the beginning of each minute. There isn't a direct way in CP but you can create an EXEC to wait for the start of the minute and then issue the CP MONITOR START command. Here is the code that I inserted in the PROFILE EXEC of the PERFSVM user id. This is the user that runs the Performance Toolkit.
/* Make the monitor intervals start on second zero */
'CP MONITOR STOP'
Parse value time('N') with hh ':' mm ':' ss .
mm=mm+1 /* Wait for the next minute */
If ss=59 then mm=mm+1 /* May need a bit more time */
If mm>60 then do /* Overflow to the hour */
'WAKEUP' hh':'right(mm,2,0)':00' /* Wait */
'CP MONITOR START' /* Start the monitor */
The code stops the monitor, queries the time, and then waits for the beginning of the next minute. When that occurs, it starts the monitor and from then on, every interval should start at the beginning of the minute.