Class Stats

  • All Implemented Interfaces:
    org.forgerock.util.thread.listener.ShutdownListener

    public class Stats
    extends Object
    implements org.forgerock.util.thread.listener.ShutdownListener

    Allows a uniform interface to statistics information in a uniform format. Stats supports different states of filing stats information: OFF, FILE and CONSOLE.

  • OFF statistics is turned off.
  • FILE statistics information is written to a file
  • CONSOLE statistics information is written on console

    Stats service uses the property file, AMConfig.properties, to set the default stats level and the output directory where the stats files will be placed. The properties file is located (using ResourceBundle semantics) from one of the directories in the CLASSPATH.

    The following keys are used to configure the Stats service. Possible values for the key 'state' are: off | off | file | console The key 'directory' specifies the output directory where the stats files will be created.

      com.iplanet.services.stats.state
      com.iplanet.services.stats.directory
     
    If there is an error reading or loading the properties, all the information is redirected to System.out If these properties are changed, the server must be restarted for the changes to take effect.

    NOTE: Printing Statistics is an IO intensive operation and may hurt application performance when abused. Particularly, note that Java evaluates the arguments to message() and warning() even when statistics is turned off. It is recommended that the stats state be checked before invoking any message() or warning() methods to avoid unnecessary argument evaluation and to maximize application performance.