KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > test > performance > Dimension


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.test.performance;
12
13 import org.eclipse.test.internal.performance.InternalDimensions;
14
15 /**
16  * Some predefined dimensions most likely supported on all platforms.
17  *
18  * This interface is not intended to be implemented by clients.
19  *
20  * @since 3.1
21  */

22 public interface Dimension {
23
24     // Dimensions available on all platforms:
25

26     /**
27      * The amount of time that the process has executed in kernel mode.
28      * It is calculated by taking the sum of the time that each of the threads of the process has executed in kernel mode.
29      */

30     public Dimension KERNEL_TIME= InternalDimensions.KERNEL_TIME;
31     
32     /**
33      * The amount of CPU time used so far by this process.
34      * It is calculated by adding the KERNEL_TIME and the amount of time that the process has executed in user mode.
35      * The user time is calculated by taking the sum of the time that each of the threads of the process has executed in user mode.
36      * It does not include any time where the process is waiting for OS resources.
37      * It is the best approximation for ELAPSED_PROCESS (which is not available on all platforms).
38      */

39     public Dimension CPU_TIME= InternalDimensions.CPU_TIME;
40     
41     /**
42      * WORKING_SET is the amount of memory in the working set of this process.
43      * The working set is the set of memory pages touched recently by the threads in the process.
44      * If free memory in the computer is above a threshold, pages are left in the working set of a process
45      * even if they are not in use. When free memory falls below a threshold, pages are removed from
46      * working sets.
47      */

48     public Dimension WORKING_SET= InternalDimensions.WORKING_SET;
49
50     /**
51      * The total elapsed time this process has been running.
52      * Since it starts at 0 on process start it can be used to measure startup time.
53      * On Windows it is calculated by subtracting the creation time of the process from the current system time.
54      * On Linux it is calculated by subtracting the value of the system property "eclipse.startTime" from
55      * System.currentTimeMillis()
56      * Please note that in contrast to the CPU_TIME the elapsed time of a process is influenced by other
57      * processes running in parallel.
58      */

59     public Dimension ELAPSED_PROCESS= InternalDimensions.ELAPSED_PROCESS;
60
61     /**
62      * The amount of memory used in the JVM.
63      * It is calculated by subtracting <code>Runtime.freeMemory()</code> from <code>Runtime.totalMemory()</code>.
64      */

65     public Dimension USED_JAVA_HEAP= InternalDimensions.USED_JAVA_HEAP;
66
67     // the following Dimensions not available on all platforms!
68

69     /**
70      * WORKING_SET_PEAK is the maximum amount of memory in the working set of this process at any point in time.
71      * The working set is the set of memory pages touched recently by the threads in the process.
72      * If free memory in the computer is above a threshold, pages are left in the working set of a process
73      * even if they are not in use. When free memory falls below a threshold, pages are removed from working sets.
74      * Currently this dimension is only available on Windows.
75      */

76     public Dimension WORKING_SET_PEAK= InternalDimensions.WORKING_SET_PEAK;
77
78     /**
79      * The total amount of committed memory (for the entire machine).
80      * Committed memory is the size of virtual memory that has been committed (as opposed to simply reserved).
81      * Committed memory must have backing (i.e., disk) storage available, or must be assured never to need disk
82      * storage (because main memory is large enough to hold it.) Notice that this is an instantaneous count,
83      * not an average over the time interval.
84      * Currently this dimension is only available on Windows.
85      */

86     public Dimension COMITTED= InternalDimensions.COMITTED;
87 }
88
Popular Tags