com.sun.sgs.impl.profile.listener
Class ProfileSampleListener

java.lang.Object
  extended by com.sun.sgs.impl.profile.listener.ProfileSampleListener
All Implemented Interfaces:
ProfileListener

public class ProfileSampleListener
extends Object
implements ProfileListener

A text-output listener that displays the distribution for all ProfileSamples updated during a fixed-size window of tasks as well as the lifetime of the program. This class uses a PowerOfTwoHistogram to display the distribution for each sample Note that this class uses a fixed number of tasks between outputs, rather than a period of time. The number of tasks can be configured by defining the com.sun.sgs.profile.listener.window.size property in the application properties file. The default window size for this class is 5000.

See Also:
ProfileSample

Field Summary
 
Fields inherited from interface com.sun.sgs.profile.ProfileListener
WINDOW_SIZE_PROPERTY
 
Constructor Summary
ProfileSampleListener(Properties properties, Identity owner, ComponentRegistry registry)
          Creates an instance of ProfileSampleListener.
 
Method Summary
 void propertyChange(PropertyChangeEvent event)
          Notifies this listener of a new change in the system properties.
 void report(ProfileReport profileReport)
          Collects the samples that are updated during this task-window and when the number of tasks reaches the windowed size, outputs a histogram for each sample that has been updated during the window and also a histogram for each sample updated during the lifetime of the application.
 void shutdown()
          Tells this listener that the system is shutting down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileSampleListener

public ProfileSampleListener(Properties properties,
                             Identity owner,
                             ComponentRegistry registry)
Creates an instance of ProfileSampleListener.

Parameters:
properties - the Properties for this listener
owner - the Identity to use for all tasks run by this listener
registry - the ComponentRegistry containing the available system components
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent event)
Notifies this listener of a new change in the system properties. This method is called for any property that changes.

The current list of supported property names is as follows:

name description new value old value
com.sun.sgs.profile.newop a new operation is registered with the system. the new operation : ProfileOperation null
com.sun.sgs.profile.threadcount the number of threads in the system has changed. the current number of threads : Integer the previous number of threads : Integer
com.sun.sgs.profile.nodeid the local node has been assigned a unique identifier the identifier for the local node: Long null

Specified by:
propertyChange in interface ProfileListener
Parameters:
event - A PropertyChangeEvent object describing the name of the property, its old and new values and the source of the change.

report

public void report(ProfileReport profileReport)
Collects the samples that are updated during this task-window and when the number of tasks reaches the windowed size, outputs a histogram for each sample that has been updated during the window and also a histogram for each sample updated during the lifetime of the application.

Specified by:
report in interface ProfileListener
Parameters:
profileReport - the summary for the finished Task

shutdown

public void shutdown()
Tells this listener that the system is shutting down.

Specified by:
shutdown in interface ProfileListener

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved