[GOODIE] PigWatcher-nk (with added percentage display in ProcessBrowser)

Doug Way dway at riskmetrics.com
Sat Mar 10 03:51:38 UTC 2001


Ned Konz wrote:
> 
> "Change Set:            PigWatcher-nk
> Date:                   8 March 2001
> Author:                 Ned Konz
> 
> Added percentage time display to ProcessBrowser. If
> a PigWatcher is running, it will use its statistics.

I enjoy watching pigs, myself.  Lovely creatures, carousing in the mud.  (Oops, wrong discussion.)

> Also greatly reduced auto-update jerkiness in ProcessBrowser
> by using garbageCollectMost rather than garbageCollect.

Great.  (I still noticed a faint jerkiness while dragging things, but it was much less than before.)

> Well, it ignores UI pigs now. You can use the interrupt key for those.

Probably a good idea, actually.  You'd probably have the PigWatcher stopping things that you didn't want stopped, otherwise. (such as doing a "method source with it" on a string, for example?)

> By the way, you can see the current tally using:
> 
>         ProcessBrowser dumpTallyOnTranscript: PigWatcher current tally
> 
> Note that this may not catch processes with priorities at or above 6
> (the priority of the IO process).
> 
> (note: this also includes a couple of ProcessBrowser fixes:
> * suspended processes can now be debugged
> * suspended processes can have their priority changed)

That's handy.  Hopefully these changes will make it into the base image ProcessBrowser. (perhaps after some further refinement, and proper PigWatcher integration)

> PigWatcher implements a simple runaway process monitoring tool
> that will suspend a process that is taking up too much of Squeak's
> time and allow user interaction. By default it watches for a Process
> that
> is taking more than 80% of the time; this threshold can be changed.
> 
>         PigWatcher startMonitoring.     'process period 20 seconds, sample rate 100
> msec'
>         PigWatcher current monitorProcessPeriod: 10 sampleRate: 20.
>         PigWatcher current threshold: 0.5.      'change from 80% to 50%'
>         PigWatcher stopMonitoring.

I guess ideally, it might be nice to have the PigWatcher integrated with the ProcessBrowser a bit more.  Perhaps there could be a menu item in the ProcessBrowser called 'turn on percentages' or 'turn on percentage update' which would start up the PigWatcher and auto-update and also show the percentage time display.  (Or, you could have various menu items which only turn on PigWatcher, or percentages, or auto-update one at a time, but that seems less convenient... probably not too many people would really need to see one without the others, better to combine them and keep the UI simple.  Probably if people want to see a live percentage update, they won't mind having the PigWatcher watching for runaway processes as a side effect.)

Or, you could even go as far as having the ProcessBrowser open up with all this stuff (auto-updating percentages) already turned on by default, which is how process monitors usually work for most systems.  But would that be going too far?  Maybe not, I dunno.  I think people using ProcessBrowser might not mind a small performance hit for this stuff while the ProcessBrowser is running.  (Obviously, PigWatcher etc. would go away when the ProcessBrowser was closed.)

Just some thoughts,

- Doug Way
  dway at riskmetrics.com





More information about the Squeak-dev mailing list