Example usage for io.netty.util.internal SystemPropertyUtil getInt

List of usage examples for io.netty.util.internal SystemPropertyUtil getInt

Introduction

In this page you can find the example usage for io.netty.util.internal SystemPropertyUtil getInt.

Prototype

public static int getInt(String key, int def) 

Source Link

Document

Returns the value of the Java system property with the specified key , while falling back to the specified default value if the property access fails.

Usage

From source file:ai.grakn.test.benchmark.BenchmarkTest.java

License:Open Source License

private int getWarmupIterations() {
    return SystemPropertyUtil.getInt("warmupIterations", -1);
}

From source file:ai.grakn.test.benchmark.BenchmarkTest.java

License:Open Source License

private int getMeasureIterations() {
    return SystemPropertyUtil.getInt("measureIterations", -1);
}

From source file:sailfish.remoting.RecycleTest.java

License:Apache License

@Test
public void testRecycleInSyncThread() throws Exception {
    //recycle//  ww  w . j a v  a 2  s  .c  om
    Resource2 resource1 = Resource2.newInstance();
    resource1.recycle();

    //don't recycle
    resource1 = Resource2.newInstance();

    Resource2 temp = null;
    // By default we allow one push to a Recycler for each 8th try on handles that were never recycled before.
    // This should help to slowly increase the capacity of the recycler while not be too sensitive to allocation
    // bursts.
    int stackDefaultRatioMask = SystemPropertyUtil.getInt("io.netty.recycler.ratio", 8) - 1;
    for (int i = 0; i < stackDefaultRatioMask; i++) {
        temp = Resource2.newInstance();
        temp.recycle();
        Assert.assertTrue(temp != Resource2.newInstance());
    }

    temp = Resource2.newInstance();
    temp.recycle();
    Assert.assertTrue(temp == Resource2.newInstance());
}