Java Code Examples for sun.jvmstat.monitor.MonitoredHost#getInterval()

The following examples show how to use sun.jvmstat.monitor.MonitoredHost#getInterval() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CR6672135.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 2
Source File: CR6672135.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 3
Source File: CR6672135.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 4
Source File: CR6672135.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 5
Source File: CR6672135.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 6
Source File: CR6672135.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 7
Source File: CR6672135.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 8
Source File: CR6672135.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 9
Source File: CR6672135.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 10
Source File: CR6672135.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 11
Source File: CR6672135.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}
 
Example 12
Source File: CR6672135.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) {
    int vmInterval;
    int hostInterval;

    try {
        MonitoredHost localHost = MonitoredHost.getMonitoredHost("localhost");
        Set vms = localHost.activeVms();
        Integer vmInt =  (Integer) vms.iterator().next();
        String uriString = "//" + vmInt + "?mode=r"; // NOI18N
        VmIdentifier vmId = new VmIdentifier(uriString);
        MonitoredVm vm = localHost.getMonitoredVm(vmId);

        vm.setInterval(INTERVAL);
        localHost.setInterval(INTERVAL);
        vmInterval = vm.getInterval();
        hostInterval = localHost.getInterval();
    } catch (Exception ex) {
        throw new Error ("Test failed",ex);
    }
    System.out.println("VM "+vmInterval);
    if (vmInterval != INTERVAL) {
        throw new Error("Test failed");
    }
    System.out.println("Host "+hostInterval);
    if (hostInterval != INTERVAL) {
        throw new Error("Test failed");
    }
}