ProfilerPlugin.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2006-2008 Sun Microsystems, Inc. 2N/A * Portions Copyright 2014-2015 ForgeRock AS * This class defines a Directory Server startup plugin that will register * itself as a configurable component that can allow for a simple sample-based * profiling mechanism within the Directory Server. When profiling is enabled, * the server will periodically (e.g., every few milliseconds) retrieve all the * stack traces for all threads in the server and aggregates them so that they * can be analyzed to see where the server is spending all of its processing * The value to use for the profiler action when no action is necessary. * The value to use for the profiler action when it should start capturing * The value to use for the profiler action when it should stop capturing * data and write the information it has collected to disk. * The value to use for the profiler action when it should stop capturing * data and discard any information that has been collected. // The DN of the configuration entry for this plugin. // The current configuration for this plugin. // The thread that is actually capturing the profile information. * Creates a new instance of this Directory Server plugin. Every plugin must * implement a default constructor (it is the only one that will be used to * create plugins defined in the configuration), and every plugin constructor * must call <CODE>super()</CODE> as its first element. // Make sure that this plugin is only registered as a startup plugin. // Make sure that the profile directory exists. // If the profiler thread is still active, then cause it to dump the // information it has captured and exit. // If the profiler should be started automatically, then do so now. // Make sure that the plugin is only registered as a startup plugin. // Make sure that the profile directory exists. * Applies the configuration changes to this change listener. * The new configuration containing the changes. * @return Returns information about the result of changing the // See if we need to perform any action. // See if the profiler thread is running. If so, then don't do // anything. Otherwise, start it. // See if the profiler thread is running. If so, then stop it and write // the information captured to disk. Otherwise, don't do anything. // See if the profiler thread is running. If so, then stop it but don't // write anything to disk. Otherwise, don't do anything.