All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.UseAndHold Maven / Gradle / Ivy

Go to download

The SSE Java native library for accessing operating system level information, runtime-reinstrumentation etc. Used as part of SPASS-meter.

The newest version!
package test;

import de.uni_hildesheim.sse.system.GathererFactory;
import de.uni_hildesheim.sse.system.IThisProcessDataGatherer;

/**
 * Uses the library and holds the lock on the native library. The aim of this 
 * class is to test whether unpacking / loading the native library works with
 * two JVMs on the same physical machine using the native library.
 * 
 * @author Holger Eichelberger
 */
public class UseAndHold {

    /**
     * Prevents external creation.
     */
    private UseAndHold() {
    }

    /**
     * Loads the library and emits the current load.
     * 
     * @param args the command line arguments - ignored
     */
    public static void main(String[] args) {
        IThisProcessDataGatherer gatherer 
            = GathererFactory.getThisProcessDataGatherer();
        while (true) {
            double load = gatherer.getCurrentProcessProcessorLoad();
            System.out.println("Load " + load);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
            }
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy