On Wednesday 12 December 2001 05:11 pm, you wrote: > I really want to keep the Profiler as isolated from the Profilable class as > possible. In order for it to be effective, the Profilable class must be > able to function without the existance of the Profiler, but expose the > profiling information when needed.
Agree. How about also providing a getName() on Profilable, thus eliminating the need to make ProfilePoint.getName() be something like "Pool: Max Size". That way a subclass of an excalibur pool implementation could set the Profilable.getName() to be something (or maybe use Configuration.getName() as a default). If you have multiple pools, having all the profile points named "Pool: Max Size" could be confusing as to which pool it came from. > I incorporated this idea, but renamed it to: > > startProfiling(); > and > stopProfiling(); > > This way the profiling process can be run multiple times during the life of > a system--and no bad side-effects should happen. Profiling should only > occur on active components/objects and not on ones that are initializing... kewl. good point :) > BTW, what is the thought on the "serialize(File)" method? > > The more I look at that, the less I like it. The question is, should this > be a method directly set by a container, or should this be a configurable > item? It doesn't give me a warm fuzzy. I think your comment helped on that, as why make a Profiler subclass just for a different output format? Also I'm not sure if Configuration objects are the right output for this either. My gut feeling is to expose two methods, String[] getProfilePoints() int[][] getProfileData() but I know that's not optimal either. Perhaps another class such as a ProfileSerializer, so you have Profiler.serialize( ProfileSerializer serializer ); and interface ProfileSerializer { void setColumns( String[] columns ); void setPoints ( int timestamp, int[] values ); } or such. And we can have concrete implementations of ProfileSerializer such as CSVProfileSerializer, SAXProfileSerializer, JdbcProfileSerializer, etc. Just thinking outloud. I may have had too much ioc/soc punch today :) -pete -- peter royal -> [EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>