author | alanb |
Fri, 02 Nov 2012 15:50:11 +0000 | |
changeset 14342 | 8435a30053c1 |
parent 9559 | 24c0a7a7297f |
child 20742 | 4ae78e8060d6 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
9559
diff
changeset
|
2 |
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package com.sun.management; |
|
27 |
||
28 |
/** |
|
29 |
* Platform-specific management interface for the operating system |
|
30 |
* on which the Java virtual machine is running. |
|
31 |
* |
|
32 |
* <p> |
|
33 |
* The <tt>OperatingSystemMXBean</tt> object returned by |
|
34 |
* {@link java.lang.management.ManagementFactory#getOperatingSystemMXBean()} |
|
35 |
* is an instance of the implementation class of this interface |
|
36 |
* or {@link UnixOperatingSystemMXBean} interface depending on |
|
37 |
* its underlying operating system. |
|
38 |
* |
|
39 |
* @author Mandy Chung |
|
40 |
* @since 1.5 |
|
41 |
*/ |
|
42 |
public interface OperatingSystemMXBean extends |
|
43 |
java.lang.management.OperatingSystemMXBean { |
|
44 |
||
45 |
/** |
|
46 |
* Returns the amount of virtual memory that is guaranteed to |
|
47 |
* be available to the running process in bytes, |
|
48 |
* or <tt>-1</tt> if this operation is not supported. |
|
49 |
* |
|
50 |
* @return the amount of virtual memory that is guaranteed to |
|
51 |
* be available to the running process in bytes, |
|
52 |
* or <tt>-1</tt> if this operation is not supported. |
|
53 |
*/ |
|
54 |
public long getCommittedVirtualMemorySize(); |
|
55 |
||
56 |
/** |
|
57 |
* Returns the total amount of swap space in bytes. |
|
58 |
* |
|
59 |
* @return the total amount of swap space in bytes. |
|
60 |
*/ |
|
61 |
public long getTotalSwapSpaceSize(); |
|
62 |
||
63 |
/** |
|
64 |
* Returns the amount of free swap space in bytes. |
|
65 |
* |
|
66 |
* @return the amount of free swap space in bytes. |
|
67 |
*/ |
|
68 |
public long getFreeSwapSpaceSize(); |
|
69 |
||
70 |
/** |
|
71 |
* Returns the CPU time used by the process on which the Java |
|
72 |
* virtual machine is running in nanoseconds. The returned value |
|
73 |
* is of nanoseconds precision but not necessarily nanoseconds |
|
74 |
* accuracy. This method returns <tt>-1</tt> if the |
|
75 |
* the platform does not support this operation. |
|
76 |
* |
|
77 |
* @return the CPU time used by the process in nanoseconds, |
|
78 |
* or <tt>-1</tt> if this operation is not supported. |
|
79 |
*/ |
|
80 |
public long getProcessCpuTime(); |
|
81 |
||
82 |
/** |
|
83 |
* Returns the amount of free physical memory in bytes. |
|
84 |
* |
|
85 |
* @return the amount of free physical memory in bytes. |
|
86 |
*/ |
|
87 |
public long getFreePhysicalMemorySize(); |
|
88 |
||
89 |
/** |
|
90 |
* Returns the total amount of physical memory in bytes. |
|
91 |
* |
|
92 |
* @return the total amount of physical memory in bytes. |
|
93 |
*/ |
|
94 |
public long getTotalPhysicalMemorySize(); |
|
9559
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
95 |
|
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
96 |
/** |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
97 |
* Returns the "recent cpu usage" for the whole system. This value is a |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
98 |
* double in the [0.0,1.0] interval. A value of 0.0 means that all CPUs |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
99 |
* were idle during the recent period of time observed, while a value |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
100 |
* of 1.0 means that all CPUs were actively running 100% of the time |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
101 |
* during the recent period being observed. All values betweens 0.0 and |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
102 |
* 1.0 are possible depending of the activities going on in the system. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
103 |
* If the system recent cpu usage is not available, the method returns a |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
104 |
* negative value. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
105 |
* |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
106 |
* @return the "recent cpu usage" for the whole system; a negative |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
107 |
* value if not available. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
108 |
* @since 1.7 |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
109 |
*/ |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
110 |
public double getSystemCpuLoad(); |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
111 |
|
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
112 |
/** |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
113 |
* Returns the "recent cpu usage" for the Java Virtual Machine process. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
114 |
* This value is a double in the [0.0,1.0] interval. A value of 0.0 means |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
115 |
* that none of the CPUs were running threads from the JVM process during |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
116 |
* the recent period of time observed, while a value of 1.0 means that all |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
117 |
* CPUs were actively running threads from the JVM 100% of the time |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
118 |
* during the recent period being observed. Threads from the JVM include |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
119 |
* the application threads as well as the JVM internal threads. All values |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
120 |
* betweens 0.0 and 1.0 are possible depending of the activities going on |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
121 |
* in the JVM process and the whole system. If the Java Virtual Machine |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
122 |
* recent CPU usage is not available, the method returns a negative value. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
123 |
* |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
124 |
* @return the "recent cpu usage" for the Java Virtual Machine process; |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
125 |
* a negative value if not available. |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
126 |
* @since 1.7 |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
127 |
*/ |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
128 |
public double getProcessCpuLoad(); |
24c0a7a7297f
7028071: Add two attributes to the OperatingSystemMXBean to provide CPU Load info
fparain
parents:
5506
diff
changeset
|
129 |
|
2 | 130 |
} |