/*
 * BEGIN FLOCK GPL
 *
 * Copyright Flock Inc. 2005-2009
 * http://flock.com
 *
 * This file may be used under the terms of the
 * GNU General Public License Version 2 or later (the "GPL"),
 * http://www.gnu.org/licenses/gpl.html
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * END FLOCK GPL
 */

#include "nsISupports.idl"

[scriptable, uuid(4B9A3546-F21A-11DB-8314-0800200C9A66)]
interface flockIProfiler : nsISupports
{
  /**
   * Logs CPU, Memory and elapsed time data for the specified event type.
   * Time lapse is measured since initialization of the logger component.
   *
   * @param aEventName (in) A string identifier for the type of event.
   * @param aMessage (in) Optional message string to provide additional context
   *        for this observation.
   */
  void profile(in AString aEventName, in AString aMessage);

  /**
   * Begins a timer for the specified event type.  Returns a unique event ID,
   * which the caller must later use as an argument to profileEventEnd() in
   * order to complete the observation.
   */
  long profileEventStart(in AString aEventName);

  /**
   * Logs CPU, Memory and elapsed time data, where time lapse is measured since
   * the call to profileEventStart().
   */
  void profileEventEnd(in long aEventID, in AString aMessage);
};
