public static AbstractStatisticsCollector newInstance(final Properties properties){
  final int interval=Integer.parseInt(properties.getProperty(Options.PERFORMANCE_COUNTERS_SAMPLE_INTERVAL,Options.DEFAULT_PERFORMANCE_COUNTERS_SAMPLE_INTERVAL));
  if (interval <= 0)   throw new IllegalArgumentException();
  final String processName=properties.getProperty(Options.PROCESS_NAME);
  if (processName == null)   throw new IllegalArgumentException("Required option not specified: " + Options.PROCESS_NAME);
  if (SystemUtil.isLinux()) {
    return new StatisticsCollectorForLinux(interval,processName);
  }
 else   if (SystemUtil.isWindows()) {
    return new StatisticsCollectorForWindows(interval,processName);
  }
 else   if (SystemUtil.isOSX()) {
    return new StatisticsCollectorForOSX(interval,processName);
  }
 else {
    throw new UnsupportedOperationException("No implementation available on " + System.getProperty("os.getname"));
  }
}

public static AbstractStatisticsCollector newInstance ( final Properties properties ) { final int interval = Integer . parseInt ( properties . getProperty ( Options . PERFORMANCE_COUNTERS_SAMPLE_INTERVAL , Options . DEFAULT_PERFORMANCE_COUNTERS_SAMPLE_INTERVAL ) ) ; if ( interval <= 0 ) throw new IllegalArgumentException ( ) ; final String processName = properties . getProperty ( Options . PROCESS_NAME ) ; if ( processName == null ) throw new IllegalArgumentException ( "Required option not specified: " + Options . PROCESS_NAME ) ; if ( SystemUtil . isLinux ( ) ) { return new StatisticsCollectorForLinux ( interval , processName ) ; } else if ( SystemUtil . isWindows ( ) ) { return new StatisticsCollectorForWindows ( interval , processName ) ; } else if ( SystemUtil . isOSX ( ) ) { return new StatisticsCollectorForOSX ( interval , processName ) ; } else { throw new UnsupportedOperationException ( "No implementation available on " + System . getProperty ( "os.getname" ) ) ; } }
create an instance appropriate for the operating system on which the jvm is running .
