[ENH] Menu access for TimeProfileBrowser

Doug Way dway at mat.net
Sat Mar 4 08:36:41 UTC 2000


After making the fixes to TimeProfileBrowser in the previous changeset, I
figured that the TimeProfileBrowser at least deserved a spot in a menu,
rather than languish in obscurity.  The TimeProfileBrowser is very handy,
it basically just parses the MessageTally output, so that you can easily
browse the methods in the pseudo-stack, and even trace through the code
(by hand).  It's especially useful for exploring performance problems in
unfamiliar code.

This changeset adds a submenu item in the debug... menu called
'start/browse MessageTally'.  This is similar to the 'start MessageTally'
item, the only difference being that a TimeProfileBrowser is brought up on
the MessageTally output at the end of the spying.

(Or, if we wanted to conserve menu space, we could simply get rid of the
'start MessageTally' item with the text-only output, but I figured it
might be best to keep both...)

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at mat.net, @eai.com
-------------- next part --------------
'From Squeak2.8alpha of 14 February 2000 [latest update: #1852] on 4 March 2000 at 1:49:20 am'!
"Change Set:		BrowseTallyMenu-dew
Date:			4 March 2000
Author:			Doug Way

Adds a 'start/browse MessageTally' item to the debug... menu.  This opens a TimeProfileBrowser on the MessageTally results, rather than a text editor."!


!HandMorph methodsFor: 'world menu' stamp: 'dew 3/4/2000 00:55'!
debugMenu
	"Build the scripting menu for the world."
	| menu |
	menu _ (MenuMorph entitled: 'debug...') defaultTarget: self.
	menu addStayUpItem.
	menu add: 'inspect world' target: owner action: #inspect.
	menu add: 'explore world' target: owner action: #explore.
	menu add: 'inspect model' action: #inspectWorldModel.
	"menu add: 'talk to world...' action: #typeInMessageToWorld."
	menu add: 'start MessageTally' action: #startMessageTally.
	menu add: 'start/browse MessageTally' action: #startThenBrowseMessageTally.
	menu addLine.
	"(self hasProperty: #errorOnDraw) ifTrue:  Later make this come up only when needed."
		menu add: 'start drawing again' target: owner action: #resumeAfterDrawError.
		menu add: 'start stepping again' target: owner action: #resumeAfterStepError.
	menu addLine.
	menu add: 'call #tempCommand' action: #callTempCommand.
	menu add: 'define #tempCommand' action: #defineTempCommand.
	^ menu
! !

!HandMorph methodsFor: 'world menu commands' stamp: 'dew 3/4/2000 00:56'!
startThenBrowseMessageTally
	| world |
	world _ self world.
	(self confirm: 'MessageTally will start now,
and stop when the cursor goes
to the top of the screen') ifTrue:
		[TimeProfileBrowser onBlock:
			[[Sensor primMousePt y > 0] whileTrue: [world doOneCycle]]]! !




More information about the Squeak-dev mailing list