On Wednesday 12 December 2001 06:56 pm, Berin Loritsch wrote:
> Each ProfilePoint is a unique sample type.  By placing the name at
> the Profilable interface level, it becomes almost impossible to
> distinguish which sample is significant.
>
> The Profilable object instantiates the ProfilePoint's names to be
> more meaningful than "Pool: Max Size" because ther can be more than
> one Pool in a system.  For instance, if the Pool is managing
> FileGenerator instances, a good name would be "{classname} Pool: Max
> Size".
>
> It is easy for a pool to implement such a naming scheme without it
> being hardcoded.

I was thinking of having both the Profilable object have a getName() as well 
as the ProfilePoint with the Profiler combining the two for serialization.  
But I do see your point that ProfilePoint.getName() can be set easily enough. 
Just go with that :)

> The ProfileSerializer idea does resonate with me.  Maybe I can
> play with it tomorrow.  The design constraints I see as optimal
> on this is that Header information is serialized first, and
> that each sample is serialized as it is received.  The methods
> you presented should be sufficient.

kewl. Yes, I was thinking similar constraints. The serializers would be 
event-driven just like a SAX contenthandler (that was my inspiration). Maybe 
changed slightly ala:

interface ProfileSerializer
{
        void start();
        void columns(String[] columns);
        void points(int timestamp, int[] values);
        void end();
}

start(), columns() and end() are all called 1x, per serialization. points() 
is called once for each reading taken. With the original outline you had know 
way of knowing that the points were complete.

> Seriously though, I think this approach is best.  The
> ProfileSerializer does need a location to send it's information
> though.

Right, but the Profiler doesn't care about that location, only concrete 
implementations ala:

Profiler.serialize( new CSVProfileSerializer( new 
File("/home/osi/profile_data.csv") ) );

(sorry about the wordwrap).

This would be then easy to integrate into Cocoon if you had a 
SAXProfileSerializer. You could hook it right into a generator :)

-pete

-- 
peter royal -> [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to