On May 31, 2010, at 4:38 14PM, Henrik Johansen wrote:
>
> On May 31, 2010, at 4:12 11PM, Mariano Martinez Peck wrote:
>
>> Alexandre: Is there a way (or will be in a future) a way to script and
>> customize it ?
>>
>> Suppose I want to trace several things, not only the amount of memory used.
>> I would love to be able to define my own curves and have several at the same
>> time.
>>
> Look at the code, it's quite simple. :)
> All you seem to have to do is subclass MMProbe, implement its interface (get
> current value, choosing a color, and potential custom rendering) and voila,
> you have a custom curve!
>
> Cheers,
> Henry
And of course, when looking a bit closer, it's even simpler :) (If you don't
need custom display etc. that is)
graph := MMGraph new.
probe := MMProbe probleBlock: [:theProbe | theProbe addValue:
someValueIWantACustomGraphFor].
graph addProbe: probe; openInWorld.
not sure if probleBlock is a spelingError :)
Cheers,
Henry
PS. Would it be possible to do:
ManuiaMonitor>> initialize
graph := MMGraph new.
graph addProbe: MUsedMemoryProbe new; addProbe: MMGCProbe new.
(and only window addMorph: graph in the open method)
and remove
self addProbe: MUsedMemoryProbe ... from MMGraph initialize?
That way, a graph not used by the monitor is empty by default, and a new
instance can be used for whatever graphing purpose one desires, like Mariano :)
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project