com.github.tamnguyenbbt.task.ThreadConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dom-util Show documentation
Show all versions of dom-util Show documentation
Find jsoup elements, relative xpath queries, and Selenium web elements for web service and Selenium-based Web UI testing
package com.github.tamnguyenbbt.task;
public class ThreadConfig
{
public final static Double ioBlockingCoefficient = 0.8;
public static int getOptimisedNumberOfThreadsForIOOperations()
{
final int numberOfCores = Runtime.getRuntime().availableProcessors();
return (int)(numberOfCores/(1-ioBlockingCoefficient));
}
}