01: /*
02: * Copyright (c) 2001 by Matt Welsh and The Regents of the University of
03: * California. All rights reserved.
04: *
05: * Permission to use, copy, modify, and distribute this software and its
06: * documentation for any purpose, without fee, and without written agreement is
07: * hereby granted, provided that the above copyright notice and the following
08: * two paragraphs appear in all copies of this software.
09: *
10: * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
11: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
12: * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
13: * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14: *
15: * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
16: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17: * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
18: * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
19: * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
20: *
21: * Author: Matt Welsh <mdw@cs.berkeley.edu>
22: *
23: */
24:
25: package seda.sandStorm.api;
26:
27: import seda.sandStorm.internal.StageGraph;
28: import java.io.IOException;
29: import java.io.PrintWriter;
30:
31: /**
32: * A ProfilerIF is responsible for profiling the behavior of the system
33: * over time. If the system is being run in profiling mode, applications
34: * can get a handle to the ProfilerIF by invoking ManagerIF.getProfiler().
35: *
36: * @see ManagerIF
37: * @author Matt Welsh
38: */
39: public interface ProfilerIF {
40:
41: /**
42: * Returns true if the system is being run in profiling mode;
43: * false otherwise.
44: */
45: public boolean enabled();
46:
47: /**
48: * Add a class to the profile. This will cause the profiler to track
49: * the object's size over time.
50: *
51: * @param name The name of the object as it should appear in the profile.
52: * @param pr The object to profile.
53: */
54: public void add(String name, ProfilableIF pr);
55:
56: /**
57: * Return a handle to the graph profiler.
58: */
59: public StageGraph getGraphProfiler();
60:
61: }
|