static int init() { nonPidFilesInProc = getNumberOfNonProcessProcFiles(); sys_cpus = Runtime.getRuntime().availableProcessors(); pageSize = Integer.getInteger(pageSizeProperty, DEFAULT_PAGESIZE); cpuStatSingleton = new CpuStat(); hasProcVmStat = new File("/proc/vmstat").exists(); hasDiskStats = new File("/proc/diskstats").exists(); st = new SpaceTokenizer(); return 0; }
static int init() { nonPidFilesInProc = getNumberOfNonProcessProcFiles(); sys_cpus = Runtime.getRuntime().availableProcessors(); pageSize = Integer.getInteger(pageSizeProperty, DEFAULT_PAGESIZE); cpuStatSingleton = new CpuStat(); hasProcVmStat = new File("/proc/vmstat").exists(); hasDiskStats = new File("/proc/diskstats").exists(); st = new SpaceTokenizer(); procFile = new File( "/proc/" + NativeCalls.getInstance().getProcessId() + "/stat" ); try { fchannel = new FileInputStream(procFile).getChannel(); } catch (FileNotFoundException e) { throw new GemFireIOException(e.getMessage(), e); } return 0; }