RISC OS Pyromaniac ticker registrations and statistics

by gerph
macOS ◆ xterm-256color ◆ fish 735 views

RISC OS ticker registrations have never really been exposed to callers. There’s been neither an official interface to read them, nor an unofficial tool that did so. During debugging of some modules I noticed that the ticker events were being called a lot more often than I had expected, in the traces I was following. So to make it easier to see what had been registered at a given time, I added a new *-command to list the currently queued ticker events. This makes it easy to see some of what the system has in use.

The list of ticker registrations shows the Classic RISC OS registrations with their call address and workspace, and the internal Python registration. In each case, the time to the next tick, and the period (if any) is shown.

Seeing that these reports were useful, I added some statistics gathering, so that it was easier to see how many events have been triggered. The statistics can be displayed through a *-command, but once they are enabled the statistics will be displayed as the system exits.

The statistcs show values for the current second, a 15 second period, a minute, and then longr periods. The current accumulator and previous period’s accumulator values are shown. The ticker system counts the number of dispatches performed (how many times code was actually called), the number of triggers performed (how many times the tickers are checked for expiry, the maximum number of items that were registered at trigger time, and the number of registrations of each type of ticker.

This recording shows how the Freeway and ShareFS modules register tickers.