com.sun.sgs.profile
Interface ProfileConsumer

All Known Implementing Classes:
ProfileConsumerImpl

public interface ProfileConsumer

A profile consumer object is used to gather profiling data for a specific system or application component. Each profile consumer has a level associated with it, which determines how much data the consumer will gather.

Profile consumers are factories for profile counters, operations, and samples. These profiling data objects come in three varieties:

The factory methods include a parameter indicating the minimum profile level the consumer must be set at for the created object's profiling data to be collected.

See Also:
ProfileCounter, ProfileOperation, ProfileSample

Nested Class Summary
static class ProfileConsumer.ProfileDataType
          The valid types of profile operations, counters and samples that can be created with the profile data factory methods.
 
Method Summary
 ProfileCounter createCounter(String name, ProfileConsumer.ProfileDataType type, ProfileCollector.ProfileLevel minLevel)
          Creates the named counter in this consumer.
 ProfileOperation createOperation(String name, ProfileConsumer.ProfileDataType type, ProfileCollector.ProfileLevel minLevel)
          Creates the named operation in this consumer.
 ProfileSample createSample(String name, ProfileConsumer.ProfileDataType type, ProfileCollector.ProfileLevel minLevel)
          Creates the named sample collection in this consumer.
 String getName()
          The profile consumer's unique name.
 ProfileCollector.ProfileLevel getProfileLevel()
          Get the local profiling level for this consumer.
 void setProfileLevel(ProfileCollector.ProfileLevel level)
          Set the local profiling level for this consumer.
 

Method Detail

setProfileLevel

void setProfileLevel(ProfileCollector.ProfileLevel level)
Set the local profiling level for this consumer. Setting the global profiling level via ProfileCollector.setDefaultProfileLevel(ProfileLevel) will override this value.

Parameters:
level - the profiling level

getProfileLevel

ProfileCollector.ProfileLevel getProfileLevel()
Get the local profiling level for this consumer. Defaults to the value of ProfileCollector.getDefaultProfileLevel().

Returns:
the profiling level

createOperation

ProfileOperation createOperation(String name,
                                 ProfileConsumer.ProfileDataType type,
                                 ProfileCollector.ProfileLevel minLevel)
Creates the named operation in this consumer. If an operation has already been created by this consumer with the same name, type and minLevel, it is returned.

Parameters:
name - the name of the operation
type - the type of operation to create
minLevel - the minimum level of profiling that must be set to report this operation
Returns:
a ProfileOperation to note operations
Throws:
IllegalArgumentException - if an operation has already been created with this name but a different type or minLevel

createCounter

ProfileCounter createCounter(String name,
                             ProfileConsumer.ProfileDataType type,
                             ProfileCollector.ProfileLevel minLevel)
Creates the named counter in this consumer. If a counter has already been created by this consumer with the same name, type and minLevel, it is returned.

Parameters:
name - the name of the counter
type - the type of counter to create
minLevel - the minimum level of profiling that must be set to update this counter
Returns:
a ProfileCounter
Throws:
IllegalArgumentException - if a counter has already been created with this name but a different type or minLevel

createSample

ProfileSample createSample(String name,
                           ProfileConsumer.ProfileDataType type,
                           ProfileCollector.ProfileLevel minLevel)
Creates the named sample collection in this consumer. If a sample has already been created by this consumer with the same name, type, and minLevel, it is returned.

Parameters:
name - a name or description of the sample collection
type - the type of sample collection to create
minLevel - the minimum level of profiling that must be set to record this sample
Returns:
a ProfileSample that collects long data
Throws:
IllegalArgumentException - if a sample collection has already been created with this name but a different type or minLevel

getName

String getName()
The profile consumer's unique name.

Returns:
the name of this consumer

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