src/java.base/share/classes/jdk/internal/platform/Metrics.java
author prappo
Wed, 30 Jan 2019 00:24:32 +0000
changeset 53563 a4b7ea85d668
parent 50545 292a4a87c321
permissions -rw-r--r--
8218022: Repeated words typos in java.base Reviewed-by: alanb, lancea, mchung Contributed-by: Andrey Turbanov <turbanoff@gmail.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     1
/*
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     4
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    10
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    15
 * accompanied this code).
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    16
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    20
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    23
 * questions.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    24
 */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    25
package jdk.internal.platform;
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    26
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    27
import java.lang.reflect.Method;
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    28
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    29
/**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    30
 * Operating System Metrics class
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    31
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    32
 * @implNote Some of the APIs within this class return metrics for an
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    33
 * "Isolation Group" or "Container".  When the term "Isolation Group"
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    34
 * is used in the API description, this refers to either:
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    35
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    36
 *<ol>
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    37
 *<li> All processes, including the current process within a container.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    38
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    39
 *<li> All processes, including the current process running together
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    40
 *    isolated from other non-isolated processes.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    41
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    42
 *<li> All processes running on a host when that there is no isolation
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    43
 *     in effect.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    44
 *</ol>
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    45
 *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    46
 * @author bobv
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    47
 * @since 11
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    48
 */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    49
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    50
public interface Metrics {
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    51
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    52
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    53
     * Returns an instance of the Metrics class.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    54
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    55
     * @return Metrics object or null if not supported on this platform.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    56
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    57
    public static Metrics systemMetrics() {
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    58
        try {
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    59
            // We currently only support cgroupv1
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    60
            Class<?> c = Class.forName("jdk.internal.platform.cgroupv1.Metrics");
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    61
            @SuppressWarnings("unchecked")
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    62
            Method m = c.getMethod("getInstance");
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    63
            return (Metrics) m.invoke(null);
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    64
        } catch (ClassNotFoundException e) {
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    65
            return null;
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    66
        } catch (ReflectiveOperationException e) {
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    67
            throw new InternalError(e);
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    68
        }
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    69
    }
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    70
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    71
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    72
     * Returns the interface responsible for providing the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    73
     * platform metrics.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    74
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    75
     * @implNote
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    76
     * Metrics are currently only supported Linux.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    77
     * The provider for Linux is cgroupsv1.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    78
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    79
     * @return The name of the provider.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    80
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    81
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    82
    public String getProvider();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    83
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    84
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    85
    /*****************************************************************
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    86
     * CPU Accounting Subsystem
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    87
     ****************************************************************/
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    88
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    89
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    90
     * Returns the aggregate time, in nanoseconds, consumed by all
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    91
     * tasks in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    92
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    93
     * @return Time in nanoseconds or 0L if metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    94
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    95
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    96
    public long getCpuUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    97
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    98
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
    99
     * Returns the aggregate time, in nanoseconds, consumed by all tasks in
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   100
     * the Isolation Group, separated by CPU. If the current process
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   101
     * is running within a container, the reported time will only be
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   102
     * valid for processes running within the same container.  The values
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   103
     * are returned in an array, one entry for each physical processor
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   104
     * on the system.  Time values for processors unavailable to this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   105
     * Group are undefined.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   106
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   107
     * @return long array of time values.  The size of the array is equal
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   108
     *         to the total number of physical processors in the system. If
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   109
     *         this metric is not available, a zero length array will be
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   110
     *         returned.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   111
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   112
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   113
    public long[] getPerCpuUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   114
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   115
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   116
     * Returns the aggregate user time, in nanoseconds, consumed by all
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   117
     * tasks in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   118
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   119
     * @return User time in nanoseconds or 0L if metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   120
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   121
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   122
    public long getCpuUserUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   123
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   124
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   125
     * Returns the aggregate system time, in nanoseconds, consumed by
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   126
     * all tasks in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   127
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   128
     * @return System time in nanoseconds or 0L if metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   129
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   130
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   131
    public long getCpuSystemUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   132
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   133
    /*****************************************************************
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   134
     * CPU Scheduling Metrics
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   135
     ****************************************************************/
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   136
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   137
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   138
     * Returns the length of the scheduling period, in
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   139
     * microseconds, for processes within the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   140
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   141
     * @return time in microseconds or 0L if metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   142
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   143
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   144
    public long getCpuPeriod();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   145
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   146
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   147
     * Returns the total available run-time allowed, in microseconds,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   148
     * during each scheduling period for all tasks in the Isolation
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   149
     * Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   150
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   151
     * @return time in microseconds or -1 if the quota is unlimited.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   152
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   153
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   154
    public long getCpuQuota();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   155
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   156
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   157
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   158
     * Returns the relative weighting of processes with the Isolation
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   159
     * Group used for prioritizing the scheduling of processes across
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   160
     * all Isolation Groups running on a host.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   161
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   162
     * @implNote
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   163
     * Popular container orchestration systems have standardized shares
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   164
     * to be multiples of 1024, where 1024 is interpreted as 1 CPU share
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   165
     * of execution.  Users can distribute CPU resources to multiple
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   166
     * Isolation Groups by specifying the CPU share weighting needed by
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   167
     * each process.  To request 2 CPUS worth of execution time, CPU shares
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   168
     * would be set to 2048.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   169
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   170
     * @return shares value or -1 if no share set.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   171
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   172
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   173
    public long getCpuShares();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   174
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   175
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   176
     * Returns the number of time-slice periods that have elapsed if
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   177
     * a CPU quota has been setup for the Isolation Group; otherwise
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   178
     * returns 0.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   179
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   180
     * @return count of elapsed periods or 0 if the quota is unlimited.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   181
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   182
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   183
    public long getCpuNumPeriods();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   184
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   185
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   186
     * Returns the number of time-slice periods that the group has
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   187
     * been throttled or limited due to the group exceeding its quota
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   188
     * if a CPU quota has been setup for the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   189
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   190
     * @return count of throttled periods or 0 if the quota is unlimited.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   191
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   192
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   193
    public long getCpuNumThrottled();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   194
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   195
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   196
     * Returns the total time duration, in nanoseconds, that the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   197
     * group has been throttled or limited due to the group exceeding
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   198
     * its quota if a CPU quota has been setup for the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   199
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   200
     * @return Throttled time in nanoseconds or 0 if the quota is unlimited.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   201
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   202
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   203
    public long getCpuThrottledTime();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   204
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   205
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   206
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   207
     * Returns the number of effective processors that this Isolation
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   208
     * group has available to it.  This effective processor count is
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   209
     * computed based on the number of dedicated CPUs, CPU shares and
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   210
     * CPU quotas in effect for this isolation group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   211
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   212
     * This method returns the same value as
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   213
     * {@link java.lang.Runtime#availableProcessors()}.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   214
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   215
     * @return The number of effective CPUs.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   216
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   217
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   218
    public long getEffectiveCpuCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   219
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   220
    /*****************************************************************
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   221
     * CPU Sets
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   222
     ****************************************************************/
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   223
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   224
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   225
     * Returns the CPUS that are available for execution of processes
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   226
     * in the current Isolation Group. The size of the array is equal
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   227
     * to the total number of CPUs and the elements in the array are the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   228
     * physical CPU numbers that are available.  Some of the CPUs returned
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   229
     * may be offline.  To get the current online CPUs, use
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   230
     * {@link getEffectiveCpuSetCpus()}.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   231
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   232
     * @return An array of available CPUs or a zero length array
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   233
     *         if the metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   234
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   235
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   236
    public int[] getCpuSetCpus();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   237
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   238
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   239
     * Returns the CPUS that are available and online for execution of
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   240
     * processes within the current Isolation Group. The size of the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   241
     * array is equal to the total number of CPUs and the elements in
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   242
     * the array are the physical CPU numbers.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   243
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   244
     * @return An array of available and online CPUs or a zero length
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   245
     *         array if the metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   246
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   247
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   248
    public int[] getEffectiveCpuSetCpus();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   249
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   250
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   251
     * Returns the memory nodes that are available for use by processes
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   252
     * in the current Isolation Group. The size of the array is equal
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   253
     * to the total number of nodes and the elements in the array are the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   254
     * physical node numbers that are available.  Some of the nodes returned
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   255
     * may be offline.  To get the current online memory nodes, use
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   256
     * {@link getEffectiveCpuSetMems()}.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   257
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   258
     * @return An array of available memory nodes or a zero length array
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   259
     *         if the metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   260
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   261
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   262
    public int[] getCpuSetMems();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   263
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   264
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   265
     * Returns the memory nodes that are available and online for use by
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   266
     * processes within the current Isolation Group. The size of the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   267
     * array is equal to the total number of nodes and the elements in
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   268
     * the array are the physical node numbers.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   269
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   270
     * @return An array of available and online nodes or a zero length
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   271
     *         array if the metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   272
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   273
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   274
    public int[] getEffectiveCpuSetMems();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   275
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   276
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   277
     * Returns the (attempts per second * 1000), if enabled, that the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   278
     * operating system tries to satisfy a memory request for any
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   279
     * process in the current Isolation Group when no free memory is
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   280
     * readily available.  Use {@link #isCpuSetMemoryPressureEnabled()} to
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
   281
     * determine if this support is enabled.
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   282
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   283
     * @return Memory pressure or 0 if not enabled or metric is not
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   284
     *         available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   285
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   286
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   287
    public double getCpuSetMemoryPressure();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   288
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   289
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   290
     * Returns the state of the memory pressure detection support.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   291
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   292
     * @return true if the support is available and enabled, otherwise false.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   293
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   294
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   295
    public boolean isCpuSetMemoryPressureEnabled();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   296
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   297
    /*****************************************************************
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   298
     * Memory Subsystem
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   299
     ****************************************************************/
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   300
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   301
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   302
     * Returns the number of times that user memory requests in the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   303
     * Isolation Group have exceeded the memory limit.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   304
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   305
     * @return The number of exceeded requests or 0 if none or metric
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   306
     *         is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   307
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   308
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   309
    public long getMemoryFailCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   310
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   311
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   312
     * Returns the maximum amount of physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   313
     * can be allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   314
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   315
     * @return The maximum amount of memory in bytes or -1 if either
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   316
     *         there is no limit set or this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   317
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   318
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   319
    public long getMemoryLimit();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   320
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   321
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   322
     * Returns the largest amount of physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   323
     * have been allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   324
     *
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
   325
     * @return The largest amount of memory in bytes or 0 if this
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   326
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   327
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   328
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   329
    public long getMemoryMaxUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   330
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   331
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   332
     * Returns the amount of physical memory, in bytes, that is currently
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   333
     * allocated in the current Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   334
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   335
     * @return The amount of memory in bytes allocated or 0 if this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   336
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   337
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   338
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   339
    public long getMemoryUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   340
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   341
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   342
     * Returns the number of times that kernel memory requests in the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   343
     * Isolation Group have exceeded the kernel memory limit.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   344
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   345
     * @return The number of exceeded requests or 0 if none or metric
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   346
     *         is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   347
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   348
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   349
    public long getKernelMemoryFailCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   350
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   351
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   352
     * Returns the maximum amount of kernel physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   353
     * can be allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   354
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   355
     * @return The maximum amount of memory in bytes or -1 if either
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   356
     *         there is no limit set or this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   357
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   358
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   359
    public long getKernelMemoryLimit();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   360
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   361
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   362
     * Returns the largest amount of kernel physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   363
     * have been allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   364
     *
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
   365
     * @return The largest amount of memory in bytes or 0 if this
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   366
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   367
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   368
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   369
    public long getKernelMemoryMaxUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   370
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   371
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   372
     * Returns the amount of kernel physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   373
     * is currently allocated in the current Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   374
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   375
     * @return The amount of memory in bytes allocated or 0 if this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   376
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   377
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   378
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   379
    public long getKernelMemoryUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   380
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   381
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   382
     * Returns the number of times that networking memory requests in the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   383
     * Isolation Group have exceeded the kernel memory limit.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   384
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   385
     * @return The number of exceeded requests or 0 if none or metric
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   386
     *         is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   387
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   388
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   389
    public long getTcpMemoryFailCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   390
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   391
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   392
     * Returns the maximum amount of networking physical memory, in bytes,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   393
     * that can be allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   394
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   395
     * @return The maximum amount of memory in bytes or -1 if either
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   396
     *         there is no limit set or this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   397
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   398
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   399
    public long getTcpMemoryLimit();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   400
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   401
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   402
     * Returns the largest amount of networking physical memory, in bytes,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   403
     * that have been allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   404
     *
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
   405
     * @return The largest amount of memory in bytes or 0 if this
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   406
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   407
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   408
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   409
    public long getTcpMemoryMaxUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   410
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   411
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   412
     * Returns the amount of networking physical memory, in bytes, that
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   413
     * is currently allocated in the current Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   414
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   415
     * @return The amount of memory in bytes allocated or 0 if this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   416
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   417
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   418
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   419
    public long getTcpMemoryUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   420
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   421
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   422
     * Returns the number of times that user memory requests in the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   423
     * Isolation Group have exceeded the memory + swap limit.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   424
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   425
     * @return The number of exceeded requests or 0 if none or metric
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   426
     *         is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   427
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   428
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   429
    public long getMemoryAndSwapFailCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   430
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   431
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   432
     * Returns the maximum amount of physical memory and swap space,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   433
     * in bytes, that can be allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   434
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   435
     * @return The maximum amount of memory in bytes or -1 if either
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   436
     *         there is no limit set or this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   437
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   438
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   439
    public long getMemoryAndSwapLimit();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   440
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   441
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   442
     * Returns the largest amount of physical memory and swap space,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   443
     * in bytes, that have been allocated in the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   444
     *
53563
a4b7ea85d668 8218022: Repeated words typos in java.base
prappo
parents: 50545
diff changeset
   445
     * @return The largest amount of memory in bytes or 0 if this
50545
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   446
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   447
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   448
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   449
    public long getMemoryAndSwapMaxUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   450
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   451
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   452
     * Returns the amount of physical memory and swap space, in bytes,
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   453
     * that is currently allocated in the current Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   454
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   455
     * @return The amount of memory in bytes allocated or 0 if this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   456
     *         metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   457
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   458
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   459
    public long getMemoryAndSwapUsage();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   460
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   461
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   462
     * Returns the state of the Operating System Out of Memory termination
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   463
     * policy.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   464
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   465
     * @return Returns true if operating system will terminate processes
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   466
     *         in the Isolation Group that exceed the amount of available
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   467
     *         memory, otherwise false.  Flase will be returned if this
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   468
     *         capability is not available on the current operating system.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   469
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   470
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   471
    public boolean isMemoryOOMKillEnabled();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   472
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   473
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   474
     * Returns the hint to the operating system that allows groups
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   475
     * to specify the minimum amount of physical memory that they need to
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   476
     * achieve reasonable performance in low memory systems.  This allows
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   477
     * host systems to provide greater sharing of memory.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   478
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   479
     * @return The minimum amount of physical memory, in bytes, that the
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   480
     *         operating system will try to maintain under low memory
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   481
     *         conditions.  If this metric is not available, 0 will be
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   482
     *         returned.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   483
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   484
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   485
    public long getMemorySoftLimit();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   486
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   487
    /*****************************************************************
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   488
     * BlKIO Subsystem
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   489
     ****************************************************************/
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   490
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   491
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   492
     * Returns the number of block I/O requests to the disk that have been
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   493
     * issued by the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   494
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   495
     * @return The count of requests or 0 if this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   496
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   497
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   498
    public long getBlkIOServiceCount();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   499
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   500
    /**
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   501
     * Returns the number of block I/O bytes that have been transferred
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   502
     * to/from the disk by the Isolation Group.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   503
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   504
     * @return The number of bytes transferred or 0 if this metric is not available.
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   505
     *
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   506
     */
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   507
    public long getBlkIOServiced();
292a4a87c321 8203357: Container Metrics
bobv
parents:
diff changeset
   508
}